diff --git a/internal/worker/state_awake.go b/internal/worker/state_awake.go index 1df44981..99efdc94 100644 --- a/internal/worker/state_awake.go +++ b/internal/worker/state_awake.go @@ -15,8 +15,9 @@ import ( const ( // How long to wait to fetch another task... - durationNoTask = 2 * time.Second // ... if there is no task now. - durationFetchFailed = 10 * time.Second // ... if fetching failed somehow. + durationNoTask = 2 * time.Second // ... if there is no task now. + durationFetchFailed = 10 * time.Second // ... if fetching failed somehow. + durationTaskComplete = 2 * time.Second // ... when a task was completed. ) func (w *Worker) gotoStateAwake(ctx context.Context) { @@ -64,7 +65,7 @@ func (w *Worker) runStateAwake(ctx context.Context) { } // Do some rate limiting. This is mostly useful while developing. - time.Sleep(2 * time.Second) + time.Sleep(durationTaskComplete) } }