[Update] Add task timeout #1
2
task.go
2
task.go
|
@ -28,7 +28,7 @@ func (i Instance) RunTask(typename string, payload []byte, priority string, retr
|
||||||
options = append(options, asynq.MaxRetry(retryTimes))
|
options = append(options, asynq.MaxRetry(retryTimes))
|
||||||
|
|
||||||
// Task timeout
|
// Task timeout
|
||||||
if i.Config.TaskTimeout != 0 {
|
if i.Config.TaskTimeout > 0 {
|
||||||
options = append(options, asynq.Timeout(i.Config.TaskTimeout))
|
options = append(options, asynq.Timeout(i.Config.TaskTimeout))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue