mirror of
https://github.com/hibiken/asynq.git
synced 2025-10-23 10:16:12 +08:00
Update rdb.ArchiveTask with more specific error types
This commit is contained in:
@@ -20,10 +20,16 @@ var (
|
||||
ErrNoProcessableTask = errors.New("no tasks are ready for processing")
|
||||
|
||||
// ErrTaskNotFound indicates that a task that matches the given identifier was not found.
|
||||
ErrTaskNotFound = errors.New("could not find a task")
|
||||
ErrTaskNotFound = fmt.Errorf("%w: could not find a task in the queue", base.ErrNotFound)
|
||||
|
||||
// ErrTaskAlreadyArchived indicates that the task in question is already in archive state.
|
||||
ErrTaskAlreadyArchived = fmt.Errorf("%w: task is already archived", base.ErrFailedPrecondition)
|
||||
|
||||
// ErrDuplicateTask indicates that another task with the same unique key holds the uniqueness lock.
|
||||
ErrDuplicateTask = errors.New("task already exists")
|
||||
|
||||
// ErrQueueNotFound indicates that a queue with the given name does not exist.
|
||||
ErrQueueNotFound = fmt.Errorf("%w: queue does not exist", base.ErrNotFound)
|
||||
)
|
||||
|
||||
const statsTTL = 90 * 24 * time.Hour // 90 days
|
||||
|
Reference in New Issue
Block a user