mirror of
https://github.com/hibiken/asynq.git
synced 2025-10-24 10:36:12 +08:00
Allow a server instance to be gracefully shutdown programmatically
This commit is contained in:
@@ -41,6 +41,7 @@ type Scheduler struct {
|
||||
// to avoid using cron.EntryID as the public API of
|
||||
// the Scheduler.
|
||||
idmap map[string]cron.EntryID
|
||||
sigs chan os.Signal
|
||||
}
|
||||
|
||||
// NewScheduler returns a new Scheduler instance given the redis connection option.
|
||||
@@ -77,6 +78,7 @@ func NewScheduler(r RedisConnOpt, opts *SchedulerOpts) *Scheduler {
|
||||
done: make(chan struct{}),
|
||||
errHandler: opts.EnqueueErrorHandler,
|
||||
idmap: make(map[string]cron.EntryID),
|
||||
sigs: make(chan os.Signal, 1),
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user