Skip to content

Commit

Permalink
Fixes the queue retry delay counter message so that it correctly post…
Browse files Browse the repository at this point in the history
…s how many seconds left till next retry.

Signed-off-by: Yuriy Losev <[email protected]>
  • Loading branch information
yalosev committed Jan 21, 2025
1 parent 977d9fa commit 8be71a6
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions pkg/task/queue/task_queue.go
Original file line number Diff line number Diff line change
Expand Up @@ -563,12 +563,12 @@ func (q *TaskQueue) waitForTask(sleepDelay time.Duration) task.Task {
}

// Wait loop still in progress: update queue status.
waitSeconds := time.Since(waitBegin).Truncate(time.Second).String()
waitTime := time.Since(waitBegin).Truncate(time.Second)
if sleepDelay == 0 {
q.Status = fmt.Sprintf("waiting for task %s", waitSeconds)
q.Status = fmt.Sprintf("waiting for task %s", waitTime.String())
} else {
delay := sleepDelay.Truncate(time.Second).String()
q.Status = fmt.Sprintf("%s (%s left of %s delay)", origStatus, waitSeconds, delay)
delay := sleepDelay.Truncate(time.Second)
q.Status = fmt.Sprintf("%s (%s left of %s delay)", origStatus, (delay - waitTime).String(), delay.String())
}
}
}
Expand Down

0 comments on commit 8be71a6

Please sign in to comment.