Skip to content

Commit

Permalink
reverting changed loop details in retry
Browse files Browse the repository at this point in the history
  • Loading branch information
dadepo committed May 27, 2022
1 parent 2252766 commit 1b34c47
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion packages/lodestar/src/util/retry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export async function retry<A>(fn: (attempt: number) => A | Promise<A>, opts?: I
const shouldRetry = opts?.shouldRetry;

let lastError: Error = Error("RetryError");
for (let i = 0; i < maxRetries; i++) {
for (let i = 1; i <= maxRetries; i++) {
try {
return await fn(i);
} catch (e) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ import chaiAsPromised from "chai-as-promised";
import {fastify} from "fastify";
import {AbortController} from "@chainsafe/abort-controller";
import {fromHexString} from "@chainsafe/ssz";
import {ExecutionEngineHttp} from "../../../src/executionEngine/http.js";
import {defaultExecutionEngineHttpOpts} from "../../../lib/executionEngine/http.js";
import {ExecutionEngineHttp, defaultExecutionEngineHttpOpts} from "../../../src/executionEngine/http.js";
import {bytesToData, numToQuantity} from "../../../src/eth1/provider/utils.js";

chai.use(chaiAsPromised);
Expand Down

0 comments on commit 1b34c47

Please sign in to comment.