2
0
mirror of https://github.com/hibiken/asynq.git synced 2025-10-23 10:16:12 +08:00

[ci skip] Clarify terminology around 'state' and 'queue'

This commit is contained in:
Ken Hibino
2020-01-19 15:21:51 -08:00
parent 9e872a4cb4
commit 04983dc00f
9 changed files with 37 additions and 32 deletions

View File

@@ -18,16 +18,16 @@ var enqallValidArgs = []string{"scheduled", "retry", "dead"}
// enqallCmd represents the enqall command
var enqallCmd = &cobra.Command{
Use: "enqall [queue name]",
Short: "Enqueues all tasks from the specified queue",
Long: `Enqall (asynqmon enqall) will enqueue all tasks from the specified queue.
Use: "enqall [state]",
Short: "Enqueues all tasks in the specified state",
Long: `Enqall (asynqmon enqall) will enqueue all tasks in the specified state.
The argument should be one of "scheduled", "retry", or "dead".
The tasks enqueued by this command will be processed as soon as it
gets dequeued by a processor.
Example: asynqmon enqall dead -> Enqueues all tasks from the dead queue`,
Example: asynqmon enqall dead -> Enqueues all dead tasks`,
ValidArgs: enqallValidArgs,
Args: cobra.ExactValidArgs(1),
Run: enqall,
@@ -64,12 +64,12 @@ func enqall(cmd *cobra.Command, args []string) {
case "dead":
n, err = r.EnqueueAllDeadTasks()
default:
fmt.Printf("error: `asynqmon enqall [queue name]` only accepts %v as the argument.\n", enqallValidArgs)
fmt.Printf("error: `asynqmon enqall [state]` only accepts %v as the argument.\n", enqallValidArgs)
os.Exit(1)
}
if err != nil {
fmt.Println(err)
os.Exit(1)
}
fmt.Printf("Enqueued %d tasks from %q queue\n", n, args[0])
fmt.Printf("Enqueued %d tasks in %q state\n", n, args[0])
}