mirror of
https://github.com/dustinkirkland/byobu
synced 2025-08-22 22:34:23 -07:00
if time (or byobu's "now") ever goes backwards, invalidate last-run cache
time could go backwards via a setting of system date backwards. It could also go backwards if byobu-statusd was running, and then was killed and started again, but that time it decided to use 'uptime' or SECONDS to get its 'now'. in the case of SECONDS, every byobu-statusd will end up on first run invalidating all cache (which isn't really so bad)
This commit is contained in:
parent
ca48252763
commit
893c1f9ade
1 changed files with 5 additions and 0 deletions
|
@ -57,6 +57,11 @@ while true; do
|
||||||
continue
|
continue
|
||||||
fi
|
fi
|
||||||
[ -r "$last" ] && read lastrun < "$last" || lastrun=0
|
[ -r "$last" ] && read lastrun < "$last" || lastrun=0
|
||||||
|
|
||||||
|
# if, for any reason the lastrun has a value greater that
|
||||||
|
# current time, we should run again
|
||||||
|
[ $lastrun -le $now ] || lastrun=0
|
||||||
|
|
||||||
status_freq "$i"
|
status_freq "$i"
|
||||||
expiry=$(($lastrun+$_RET))
|
expiry=$(($lastrun+$_RET))
|
||||||
find_script "$i" && path="$_RET" || path=/dev/null
|
find_script "$i" && path="$_RET" || path=/dev/null
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue