Moved sleep instruction to after execution of lined task

loop_loop_execution
Paulo Truta 2021-02-18 23:02:31 +00:00
parent 3cc670b823
commit 57a9ef3eed
1 changed files with 5 additions and 3 deletions

View File

@ -111,10 +111,8 @@ func systemIterator(name *string, tick int) {
log.Printf("System not ready. Next try will be executed in 60 seconds")
time.Sleep(defaultNotReadySleepTime)
} else {
tasks.ExecuteSchedules(tick)
// Wait about 1 second before resumming operations.
log.Printf("Next instruction will be executed 1 second")
time.Sleep(defaultSleepTime)
nextTask := tasks.GetNextTask()
if nextTask.Task != "" {
log.Printf("Executing task %s / Args: %s", nextTask.Task, nextTask.Args)
@ -123,6 +121,10 @@ func systemIterator(name *string, tick int) {
log.Printf("No tasks to execute.")
}
// Wait about 1 second before resumming operations.
log.Printf("Next instruction will be executed 1 second")
time.Sleep(defaultSleepTime)
}
}