mirror of
https://github.com/hibiken/asynq.git
synced 2024-12-25 07:12:17 +08:00
allow cancel without retry
This commit is contained in:
parent
489e21920b
commit
35edb0281b
@ -337,9 +337,12 @@ func (p *processor) handleFailedMessage(ctx context.Context, l *base.Lease, msg
|
||||
}
|
||||
switch {
|
||||
case errors.Is(err, RevokeTask):
|
||||
p.logger.Warnf("revoke task id=%s", msg.ID)
|
||||
p.logger.Warnf("Revoke task id=%s", msg.ID)
|
||||
p.markAsDone(l, msg)
|
||||
case msg.Retried >= msg.Retry || errors.Is(err, SkipRetry):
|
||||
case ctx.Err() == context.Canceled || errors.Is(err, SkipRetry):
|
||||
p.logger.Warnf("Task canceled, skipping retry for id=%s", msg.ID)
|
||||
p.archive(l, msg, err)
|
||||
case msg.Retried >= msg.Retry:
|
||||
p.logger.Warnf("Retry exhausted for task id=%s", msg.ID)
|
||||
p.archive(l, msg, err)
|
||||
default:
|
||||
|
Loading…
Reference in New Issue
Block a user