Fixed timing to be 0-3
This commit is contained in:
@@ -116,8 +116,8 @@ dispatch_task() {
|
|||||||
# now, today 01:00, tomorrow 01:00 (local time)
|
# now, today 01:00, tomorrow 01:00 (local time)
|
||||||
local now_s today1_s tomorrow1_s next1_s diff_s ceil_h rnd extra_h total_h
|
local now_s today1_s tomorrow1_s next1_s diff_s ceil_h rnd extra_h total_h
|
||||||
now_s="$(date +%s)"
|
now_s="$(date +%s)"
|
||||||
today1_s="$(date -d 'today 01:00' +%s)"
|
today1_s="$(date -d 'today 00:00' +%s)"
|
||||||
tomorrow1_s="$(date -d 'tomorrow 01:00' +%s)"
|
tomorrow1_s="$(date -d 'tomorrow 00:00' +%s)"
|
||||||
if (( now_s < today1_s )); then
|
if (( now_s < today1_s )); then
|
||||||
next1_s="$today1_s"
|
next1_s="$today1_s"
|
||||||
else
|
else
|
||||||
@@ -127,7 +127,7 @@ dispatch_task() {
|
|||||||
# Ceil hours so current minutes are preserved as in your examples
|
# Ceil hours so current minutes are preserved as in your examples
|
||||||
ceil_h=$(( (diff_s + 3599) / 3600 ))
|
ceil_h=$(( (diff_s + 3599) / 3600 ))
|
||||||
rnd=$(( (RANDOM % 4) + 1 )) # 1..4
|
rnd=$(( (RANDOM % 4) + 1 )) # 1..4
|
||||||
total_h=$(( ceil_h + rnd ))
|
total_h=$(( ceil_h + rnd - 1 ))
|
||||||
|
|
||||||
extra_nbplay_opts+=("-erebootin=${total_h}")
|
extra_nbplay_opts+=("-erebootin=${total_h}")
|
||||||
log "Resolved '${task}' → base='${base_task}', rebootin=${total_h}h (ceil_to_1am=${ceil_h}h + rand=${rnd}h)"
|
log "Resolved '${task}' → base='${base_task}', rebootin=${total_h}h (ceil_to_1am=${ceil_h}h + rand=${rnd}h)"
|
||||||
|
|||||||
Reference in New Issue
Block a user