From 3bf2dc52406e2f4651ddc550fdd31cf82ea00948 Mon Sep 17 00:00:00 2001 From: Mikhail Scherba Date: Tue, 21 Jan 2025 15:44:12 +0300 Subject: [PATCH 1/3] fix retry message Signed-off-by: Mikhail Scherba --- pkg/task/queue/task_queue.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pkg/task/queue/task_queue.go b/pkg/task/queue/task_queue.go index 44e64bc8..8f9beadc 100644 --- a/pkg/task/queue/task_queue.go +++ b/pkg/task/queue/task_queue.go @@ -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() + waitSeconds := 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", waitSeconds.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-waitSeconds).String(), delay.String()) } } } From d52ce647876e8a50474bbf6ad8f50374cf2515e1 Mon Sep 17 00:00:00 2001 From: Mikhail Scherba Date: Tue, 21 Jan 2025 16:17:40 +0300 Subject: [PATCH 2/3] fmt Signed-off-by: Mikhail Scherba --- pkg/task/queue/task_queue.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/task/queue/task_queue.go b/pkg/task/queue/task_queue.go index 8f9beadc..2c95c6ac 100644 --- a/pkg/task/queue/task_queue.go +++ b/pkg/task/queue/task_queue.go @@ -568,7 +568,7 @@ func (q *TaskQueue) waitForTask(sleepDelay time.Duration) task.Task { q.Status = fmt.Sprintf("waiting for task %s", waitSeconds.String()) } else { delay := sleepDelay.Truncate(time.Second) - q.Status = fmt.Sprintf("%s (%s left of %s delay)", origStatus, (delay-waitSeconds).String(), delay.String()) + q.Status = fmt.Sprintf("%s (%s left of %s delay)", origStatus, (delay - waitSeconds).String(), delay.String()) } } } From 118146c03fb3ff46cdffb3a430a103888563f127 Mon Sep 17 00:00:00 2001 From: Mikhail Scherba Date: Tue, 21 Jan 2025 16:35:52 +0300 Subject: [PATCH 3/3] fix lint Signed-off-by: Mikhail Scherba --- pkg/task/queue/task_queue.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkg/task/queue/task_queue.go b/pkg/task/queue/task_queue.go index 2c95c6ac..724534ea 100644 --- a/pkg/task/queue/task_queue.go +++ b/pkg/task/queue/task_queue.go @@ -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) + waitTime := time.Since(waitBegin).Truncate(time.Second) if sleepDelay == 0 { - q.Status = fmt.Sprintf("waiting for task %s", waitSeconds.String()) + q.Status = fmt.Sprintf("waiting for task %s", waitTime.String()) } else { delay := sleepDelay.Truncate(time.Second) - q.Status = fmt.Sprintf("%s (%s left of %s delay)", origStatus, (delay - waitSeconds).String(), delay.String()) + q.Status = fmt.Sprintf("%s (%s left of %s delay)", origStatus, (delay - waitTime).String(), delay.String()) } } }