2
0
mirror of https://github.com/hibiken/asynq.git synced 2025-10-24 22:46:11 +08:00

Add GetTaskInfo method to RDB

This commit is contained in:
Ken Hibino
2021-03-31 06:44:56 -07:00
parent 56af9f6686
commit 3f0bc6d738
5 changed files with 278 additions and 9 deletions

View File

@@ -237,6 +237,31 @@ func DecodeMessage(data []byte) (*TaskMessage, error) {
}, nil
}
type TaskInfo struct {
*TaskMessage
// State of the task.
// Possible values are the following:
// - active
// - pending
// - scheduled
// - retry
// - archived
State string
// NextProcessAt specifies the next processing time for the task in Unix time,
// the number of seconds elapsed since January 1, 1970 UTC.
//
// Value zero is used when task is in active or archived state.
NextProcessAt int64
// LastFailedAt specifieds the last time task failed in Unix time,
// the number of seconds elapsed since January 1, 1970 UTC.
//
// Value zero is used if the task has not failed.
LastFailedAt int64
}
// Z represents sorted set member.
type Z struct {
Message *TaskMessage