Skip to content

Commit

Permalink
ARTEMIS-4743 Renaming --loop-sleep as just --sleep
Browse files Browse the repository at this point in the history
Notice that I'm keeping the old argument here as hidden
As I keep using this myself, my brain always go to ./artemis queue stat --sleep

So, I think people would feel more comfortable if the parameter was renamed.
  • Loading branch information
clebertsuconic committed May 10, 2024
1 parent 7707645 commit e78136b
Showing 1 changed file with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,10 @@ public enum OPERATION {
private boolean useLoop = false;

private static final long DEFAULT_SLEEP = 60_000;
@Option(names = "--loop-sleep", description = "Amount of Milliseconds to sleep before each iteration on queue stat. Default=60000")
@Option(names = "--loop-sleep", description = "Amount of Milliseconds to sleep before each iteration on queue stat. Default=60000", hidden = true)
private long oldSleep = -1;

@Option(names = "--sleep", description = "Amount of Milliseconds to sleep before each iteration on queue stat. Default=60000")
private long loopSleep = -1;

@Option(names = "--single-line-header", description = "Use a single line on the header titles")
Expand Down Expand Up @@ -186,6 +189,11 @@ public Object execute(ActionContext context) throws Exception {

singleExeuction(context, filter);

// if using the hidden parameter
if (oldSleep != -1) {
loopSleep = oldSleep;
}

if (loopSleep != -1) {
// if --loop-sleep was passed as an argument, it is assumed the user also meant --loop
useLoop = true;
Expand Down

0 comments on commit e78136b

Please sign in to comment.