mirror of
https://github.com/hibiken/asynq.git
synced 2024-11-10 11:31:58 +08:00
Fix Client.Enqueue to always call enqueue
Closes https://github.com/hibiken/asynq/issues/158
This commit is contained in:
parent
8bf5917cd9
commit
4e5f596910
@ -232,7 +232,8 @@ func (c *Client) enqueueAt(t time.Time, task *Task, opts ...Option) error {
|
||||
UniqueKey: uniqueKey(task, opt.uniqueTTL, opt.queue),
|
||||
}
|
||||
var err error
|
||||
if time.Now().After(t) {
|
||||
now := time.Now()
|
||||
if t.Before(now) || t.Equal(now) {
|
||||
err = c.enqueue(msg, opt.uniqueTTL)
|
||||
} else {
|
||||
err = c.schedule(msg, t, opt.uniqueTTL)
|
||||
|
Loading…
Reference in New Issue
Block a user