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:
@@ -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])
|
||||
}
|
||||
|
Reference in New Issue
Block a user