Skip to content

Commit 2eb90a5

Browse files
committed
refactor: remove magic number
1 parent 18c9919 commit 2eb90a5

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/helpers/strategies.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ type Strategy = {
1010
};
1111

1212
const RUN_INTERVAL = 60e3;
13+
const MAX_CONSECUTIVE_FAILS = 3;
1314
const URI = new URL(
1415
'/api/strategies',
1516
process.env.SCORE_API_URL ?? 'https://score.snapshot.org'
@@ -49,7 +50,7 @@ export async function run() {
4950
} catch (e: any) {
5051
consecutiveFailsCount++;
5152

52-
if (consecutiveFailsCount >= 3) {
53+
if (consecutiveFailsCount >= MAX_CONSECUTIVE_FAILS) {
5354
capture(e);
5455
}
5556
log.error(`[strategies] failed to load ${JSON.stringify(e)}`);

0 commit comments

Comments
 (0)