mirror of
https://github.com/hibiken/asynq.git
synced 2024-12-25 23:32:17 +08:00
Add LastFailedAt to TaskInfo
This commit is contained in:
parent
87264b66f3
commit
cd351d49b9
4
asynq.go
4
asynq.go
@ -81,6 +81,10 @@ func (info *TaskInfo) Retried() int { return info.msg.Retried }
|
||||
// If the task has no failures, returns an empty string.
|
||||
func (info *TaskInfo) LastErr() string { return info.msg.ErrorMsg }
|
||||
|
||||
// LastFailedAt returns the time of the last failure if any.
|
||||
// If the task has no failures, returns zero time.
|
||||
func (info *TaskInfo) LastFailedAt() time.Time { return time.Unix(info.msg.LastFailedAt, 0) }
|
||||
|
||||
// Timeout returns the duration the task can be processed by Handler before being retried,
|
||||
// zero if not specified
|
||||
func (info *TaskInfo) Timeout() time.Duration {
|
||||
|
Loading…
Reference in New Issue
Block a user