2
0
mirror of https://github.com/hibiken/asynq.git synced 2024-11-10 11:31:58 +08:00

Fix godoc around errors returned from Inspector

This commit is contained in:
Ken Hibino 2021-11-09 15:43:04 -08:00
parent 413afc2ab6
commit 531d1ef089

View File

@ -177,8 +177,8 @@ func (i *Inspector) DeleteQueue(qname string, force bool) error {
// GetTaskInfo retrieves task information given a task id and queue name. // GetTaskInfo retrieves task information given a task id and queue name.
// //
// Returns ErrQueueNotFound if a queue with the given name doesn't exist. // Returns an error wrapping 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 ErrTaskNotFound if a task with the given id doesn't exist in the queue.
func (i *Inspector) GetTaskInfo(qname, id string) (*TaskInfo, error) { func (i *Inspector) GetTaskInfo(qname, id string) (*TaskInfo, error) {
info, err := i.rdb.GetTaskInfo(qname, id) info, err := i.rdb.GetTaskInfo(qname, id)
switch { 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, // The task needs to be in pending, scheduled, retry, or archived state,
// otherwise DeleteTask will return an error. // otherwise DeleteTask will return an error.
// //
// If a queue with the given name doesn't exist, it returns ErrQueueNotFound. // 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 ErrTaskNotFound. // 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. // If the task is in active state, it returns a non-nil error.
func (i *Inspector) DeleteTask(qname, id string) error { func (i *Inspector) DeleteTask(qname, id string) error {
if err := base.ValidateQueueName(qname); err != nil { 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 // The task needs to be in scheduled, retry, or archived state, otherwise RunTask
// will return an error. // will return an error.
// //
// If a queue with the given name doesn't exist, it returns ErrQueueNotFound. // 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 ErrTaskNotFound. // 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. // If the task is in pending or active state, it returns a non-nil error.
func (i *Inspector) RunTask(qname, id string) error { func (i *Inspector) RunTask(qname, id string) error {
if err := base.ValidateQueueName(qname); err != nil { 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 // The task needs to be in pending, scheduled, or retry state, otherwise ArchiveTask
// will return an error. // will return an error.
// //
// If a queue with the given name doesn't exist, it returns ErrQueueNotFound. // 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 ErrTaskNotFound. // 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. // If the task is in already archived, it returns a non-nil error.
func (i *Inspector) ArchiveTask(qname, id string) error { func (i *Inspector) ArchiveTask(qname, id string) error {
if err := base.ValidateQueueName(qname); err != nil { if err := base.ValidateQueueName(qname); err != nil {