Minor improvements

This commit is contained in:
Ken Hibino
2019-12-27 20:37:15 -08:00
parent 2e91c49c3f
commit 4ceb49cfd1
4 changed files with 178 additions and 179 deletions

View File

@@ -32,23 +32,26 @@ func FailureKey(t time.Time) string {
}
// TaskMessage is the internal representation of a task with additional metadata fields.
// Serialized data of this type gets written in redis.
// Serialized data of this type gets written to redis.
type TaskMessage struct {
//-------- Task fields --------
// Type represents the kind of task.
// Type indicates the kind of the task to be performed.
Type string
// Payload holds data needed to process the task.
Payload map[string]interface{}
//-------- Metadata fields --------
// ID is a unique identifier for each task
// ID is a unique identifier for each task.
ID xid.ID
// Queue is a name this message should be enqueued to
// Queue is a name this message should be enqueued to.
Queue string
// Retry is the max number of retry for this task.
Retry int
// Retried is the number of times we've retried this task so far
// Retried is the number of times we've retried this task so far.
Retried int
// ErrorMsg holds the error message from the last failure
// ErrorMsg holds the error message from the last failure.
ErrorMsg string
}