Worker: move wait time into variable
No functional changes.
This commit is contained in:
parent
41d3c27c40
commit
9dbc952c09
@ -17,6 +17,7 @@ const (
|
|||||||
// How long to wait to fetch another task...
|
// How long to wait to fetch another task...
|
||||||
durationNoTask = 2 * time.Second // ... if there is no task now.
|
durationNoTask = 2 * time.Second // ... if there is no task now.
|
||||||
durationFetchFailed = 10 * time.Second // ... if fetching failed somehow.
|
durationFetchFailed = 10 * time.Second // ... if fetching failed somehow.
|
||||||
|
durationTaskComplete = 2 * time.Second // ... when a task was completed.
|
||||||
)
|
)
|
||||||
|
|
||||||
func (w *Worker) gotoStateAwake(ctx context.Context) {
|
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.
|
// Do some rate limiting. This is mostly useful while developing.
|
||||||
time.Sleep(2 * time.Second)
|
time.Sleep(durationTaskComplete)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user