Skip to content

Commit

Permalink
CLI: Fix batch reset sleep and usage explaination (cadence-workflow#1773
Browse files Browse the repository at this point in the history
)

* fix sleep

* Fix usage

* Fix usage
  • Loading branch information
longquanzheng authored May 2, 2019
1 parent 3fcd5f4 commit c89ed98
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
1 change: 1 addition & 0 deletions tools/cli/commands.go
Original file line number Diff line number Diff line change
Expand Up @@ -1310,6 +1310,7 @@ func processResets(c *cli.Context, domain string, wes chan shared.WorkflowExecut
fmt.Println("failed and retry...: ", wid, rid, err)
time.Sleep(time.Millisecond * time.Duration(rand.Intn(2000)))
}
time.Sleep(time.Millisecond * time.Duration(rand.Intn(1000)))
if err != nil {
fmt.Println("[ERROR] failed processing: ", wid, rid)
}
Expand Down
11 changes: 6 additions & 5 deletions tools/cli/workflow.go
Original file line number Diff line number Diff line change
Expand Up @@ -228,14 +228,15 @@ func newWorkflowCommands() []cli.Command {
Flags: []cli.Flag{
cli.StringFlag{
Name: FlagInputFileWithAlias,
Usage: "Input file to use for resetting",
Usage: "Input file to use for resetting, one workflow per line of WorkflowID and RunID. RunID is optional, default to current runID if not specified. ",
},
cli.StringFlag{
Name: FlagExcludeFile,
Usage: "Another input file to use for excluding from resetting",
Usage: "Another input file to use for excluding from resetting, only workflowID is needed.",
},
cli.StringFlag{
Name: FlagInputSeparator,
Value: ",",
Usage: "Separator for input file",
},
cli.StringFlag{
Expand All @@ -245,15 +246,15 @@ func newWorkflowCommands() []cli.Command {
cli.IntFlag{
Name: FlagParallism,
Value: 1,
Usage: "batch in parallel",
Usage: "Number of goroutines to run in parallel. Each goroutine would process one line for every second.",
},
cli.BoolFlag{
Name: FlagSkipCurrent,
Usage: "skip current open",
Usage: "Skip the workflow if the current run is open.",
},
cli.StringFlag{
Name: FlagResetType,
Usage: "where to reset. Support one of these: LastDecisionCompleted,LastContinuedAsNew",
Usage: "How to reset, currently support: LastDecisionCompleted,LastContinuedAsNew",
},
},
Action: func(c *cli.Context) {
Expand Down

0 comments on commit c89ed98

Please sign in to comment.