mirror of
https://github.com/hibiken/asynq.git
synced 2024-11-14 11:31:18 +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),
|
UniqueKey: uniqueKey(task, opt.uniqueTTL, opt.queue),
|
||||||
}
|
}
|
||||||
var err error
|
var err error
|
||||||
if time.Now().After(t) {
|
now := time.Now()
|
||||||
|
if t.Before(now) || t.Equal(now) {
|
||||||
err = c.enqueue(msg, opt.uniqueTTL)
|
err = c.enqueue(msg, opt.uniqueTTL)
|
||||||
} else {
|
} else {
|
||||||
err = c.schedule(msg, t, opt.uniqueTTL)
|
err = c.schedule(msg, t, opt.uniqueTTL)
|
||||||
|
Loading…
Reference in New Issue
Block a user