Skip to content

Commit

Permalink
Set infinity as default max_retry_count
Browse files Browse the repository at this point in the history
  • Loading branch information
zzaakiirr committed Aug 22, 2024
1 parent 967a760 commit e3c1739
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 12 deletions.
2 changes: 1 addition & 1 deletion lib/command/base.rb
Original file line number Diff line number Diff line change
Expand Up @@ -474,7 +474,7 @@ def step_finish(success, abort_on_error: true)
end
end

def step(message, abort_on_error: true, retry_on_failure: false, max_retry_count: 5, wait: 1) # rubocop:disable Metrics/MethodLength
def step(message, abort_on_error: true, retry_on_failure: false, max_retry_count: Float::INFINITY, wait: 1) # rubocop:disable Metrics/MethodLength
progress.print("#{message}...")

Shell.use_tmp_stderr do
Expand Down
11 changes: 0 additions & 11 deletions spec/command/base_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,6 @@
context "with retry_on_failure: true" do
let(:options) { { retry_on_failure: true, wait: 0 } }

it "does not exceed default max_retry_count" do
run_count = 0

command.step(message, **options) do
run_count += 1
false
end

expect(run_count).to eq 5
end

it "retries block until success" do
run_count = 0

Expand Down

0 comments on commit e3c1739

Please sign in to comment.