mirror of
https://github.com/hibiken/asynq.git
synced 2024-12-24 06:42:16 +08:00
Minor cleanup
This commit is contained in:
parent
22b21df884
commit
ade97befbc
@ -37,14 +37,11 @@ type Background struct {
|
||||
|
||||
// Config specifies the background-task processing behavior.
|
||||
type Config struct {
|
||||
// Max number of concurrent workers to process tasks.
|
||||
// Maximum number of concurrent workers to process tasks.
|
||||
//
|
||||
// If set to zero or negative value, NewBackground will overwrite the value to one.
|
||||
Concurrency int
|
||||
|
||||
// TODO(hibiken): Add ShutdownTimeout
|
||||
// ShutdownTimeout time.Duration
|
||||
|
||||
// Function to calculate retry delay for a failed task.
|
||||
//
|
||||
// By default, it uses exponential backoff algorithm to calculate the delay.
|
||||
|
@ -70,7 +70,7 @@ func (p *processor) stop() {
|
||||
func (p *processor) terminate() {
|
||||
p.stop()
|
||||
|
||||
// TODO(hibiken): Allow user to customize this timeout value.
|
||||
// IDEA: Allow user to customize this timeout value.
|
||||
const timeout = 8 * time.Second
|
||||
time.AfterFunc(timeout, func() { close(p.quit) })
|
||||
log.Println("[INFO] Waiting for all workers to finish...")
|
||||
|
Loading…
Reference in New Issue
Block a user