Skip to content

Commit

Permalink
Expose cooldown time argument as an option
Browse files Browse the repository at this point in the history
  • Loading branch information
k5342 committed Aug 13, 2024
1 parent b2a25b5 commit 0a35fb8
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@ public class AddAclKeyHandler extends AclHandler {
@CommandLine.Mixin
private PrefixUri prefix;

@CommandLine.Option(names = {"--cooldown-time"}, defaultValue = "10",
description = "cooldown time to issue API call in milliseconds")
private int cooldownTime;

@Override
protected OzoneAddress getAddress() {
return address.getValue();
Expand Down Expand Up @@ -115,7 +119,7 @@ class Key {
}
// We introduce this wait to avoid data corruption
try {
Thread.sleep(10);
Thread.sleep(cooldownTime);
} catch (InterruptedException e) {
throw new RuntimeException("interrupted");
}
Expand Down

0 comments on commit 0a35fb8

Please sign in to comment.