Services: move sleep to upper layer to improve accuracy

This commit is contained in:
bergware
2025-05-08 15:59:10 +02:00
parent b52defdbda
commit 582cefbfc1
2 changed files with 1 additions and 4 deletions

View File

@@ -8,9 +8,6 @@ queue(){
atq | grep -Pom1 '^\d+'
}
# delayed execution
sleep ${1:-1}
JOB=$(queue)
if [[ -n $JOB ]]; then
atrm $JOB 2>/dev/null

View File

@@ -15,6 +15,6 @@ else
log "no queued job present"
fi
echo "/usr/local/emhttp/webGui/scripts/reload_services ${1:-1}" | at -M now 2>/dev/null
echo "sleep ${1:-1}; /usr/local/emhttp/webGui/scripts/reload_services" | at -M now 2>/dev/null
log "queue new job $(queue), wait for ${1:-1}s"
exit 0