2
0
mirror of https://github.com/hibiken/asynq.git synced 2024-11-10 11:31:58 +08:00

Minor cleanup

This commit is contained in:
Ken Hibino 2019-12-30 07:10:13 -08:00
parent 22b21df884
commit ade97befbc
2 changed files with 2 additions and 5 deletions

View File

@ -37,14 +37,11 @@ type Background struct {
// Config specifies the background-task processing behavior. // Config specifies the background-task processing behavior.
type Config struct { 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. // If set to zero or negative value, NewBackground will overwrite the value to one.
Concurrency int Concurrency int
// TODO(hibiken): Add ShutdownTimeout
// ShutdownTimeout time.Duration
// Function to calculate retry delay for a failed task. // Function to calculate retry delay for a failed task.
// //
// By default, it uses exponential backoff algorithm to calculate the delay. // By default, it uses exponential backoff algorithm to calculate the delay.

View File

@ -70,7 +70,7 @@ func (p *processor) stop() {
func (p *processor) terminate() { func (p *processor) terminate() {
p.stop() p.stop()
// TODO(hibiken): Allow user to customize this timeout value. // IDEA: Allow user to customize this timeout value.
const timeout = 8 * time.Second const timeout = 8 * time.Second
time.AfterFunc(timeout, func() { close(p.quit) }) time.AfterFunc(timeout, func() { close(p.quit) })
log.Println("[INFO] Waiting for all workers to finish...") log.Println("[INFO] Waiting for all workers to finish...")