mirror of
https://github.com/hibiken/asynq.git
synced 2024-12-25 23:32:17 +08:00
Fix godoc around errors returned from Inspector
This commit is contained in:
parent
413afc2ab6
commit
531d1ef089
16
inspector.go
16
inspector.go
@ -177,8 +177,8 @@ func (i *Inspector) DeleteQueue(qname string, force bool) error {
|
||||
|
||||
// GetTaskInfo retrieves task information given a task id and queue name.
|
||||
//
|
||||
// Returns ErrQueueNotFound if a queue with the given name doesn't exist.
|
||||
// Returns ErrTaskNotFound if a task with the given id doesn't exist in the queue.
|
||||
// Returns an error wrapping ErrQueueNotFound if a queue with the given name doesn't exist.
|
||||
// Returns an error wrapping ErrTaskNotFound if a task with the given id doesn't exist in the queue.
|
||||
func (i *Inspector) GetTaskInfo(qname, id string) (*TaskInfo, error) {
|
||||
info, err := i.rdb.GetTaskInfo(qname, id)
|
||||
switch {
|
||||
@ -479,8 +479,8 @@ func (i *Inspector) DeleteAllCompletedTasks(qname string) (int, error) {
|
||||
// The task needs to be in pending, scheduled, retry, or archived state,
|
||||
// otherwise DeleteTask will return an error.
|
||||
//
|
||||
// If a queue with the given name doesn't exist, it returns ErrQueueNotFound.
|
||||
// If a task with the given id doesn't exist in the queue, it returns ErrTaskNotFound.
|
||||
// If a queue with the given name doesn't exist, it returns an error wrapping ErrQueueNotFound.
|
||||
// If a task with the given id doesn't exist in the queue, it returns an error wrapping ErrTaskNotFound.
|
||||
// If the task is in active state, it returns a non-nil error.
|
||||
func (i *Inspector) DeleteTask(qname, id string) error {
|
||||
if err := base.ValidateQueueName(qname); err != nil {
|
||||
@ -533,8 +533,8 @@ func (i *Inspector) RunAllArchivedTasks(qname string) (int, error) {
|
||||
// The task needs to be in scheduled, retry, or archived state, otherwise RunTask
|
||||
// will return an error.
|
||||
//
|
||||
// If a queue with the given name doesn't exist, it returns ErrQueueNotFound.
|
||||
// If a task with the given id doesn't exist in the queue, it returns ErrTaskNotFound.
|
||||
// If a queue with the given name doesn't exist, it returns an error wrapping ErrQueueNotFound.
|
||||
// If a task with the given id doesn't exist in the queue, it returns an error wrapping ErrTaskNotFound.
|
||||
// If the task is in pending or active state, it returns a non-nil error.
|
||||
func (i *Inspector) RunTask(qname, id string) error {
|
||||
if err := base.ValidateQueueName(qname); err != nil {
|
||||
@ -586,8 +586,8 @@ func (i *Inspector) ArchiveAllRetryTasks(qname string) (int, error) {
|
||||
// The task needs to be in pending, scheduled, or retry state, otherwise ArchiveTask
|
||||
// will return an error.
|
||||
//
|
||||
// If a queue with the given name doesn't exist, it returns ErrQueueNotFound.
|
||||
// If a task with the given id doesn't exist in the queue, it returns ErrTaskNotFound.
|
||||
// If a queue with the given name doesn't exist, it returns an error wrapping ErrQueueNotFound.
|
||||
// If a task with the given id doesn't exist in the queue, it returns an error wrapping ErrTaskNotFound.
|
||||
// If the task is in already archived, it returns a non-nil error.
|
||||
func (i *Inspector) ArchiveTask(qname, id string) error {
|
||||
if err := base.ValidateQueueName(qname); err != nil {
|
||||
|
Loading…
Reference in New Issue
Block a user