Skip to content

Commit 118e57f

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent 42f5841 commit 118e57f

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

fetch.js

+11-3
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,17 @@ async function fetchWithRetry(options, data, retries = 5, delay = 5000) {
3434
resolve(responseData);
3535
} else if (res.statusCode === 429 && i < retries - 1) {
3636
console.log(`Rate limited. Retrying in ${delay}ms...`);
37-
setTimeout(() => resolve(fetchWithRetry(options, data, retries - 1, delay)), delay);
37+
setTimeout(
38+
() =>
39+
resolve(fetchWithRetry(options, data, retries - 1, delay)),
40+
delay
41+
);
3842
} else {
39-
reject(new Error(`${options.path} request failed with status code: ${res.statusCode}`));
43+
reject(
44+
new Error(
45+
`${options.path} request failed with status code: ${res.statusCode}`
46+
)
47+
);
4048
}
4149
});
4250
});
@@ -151,4 +159,4 @@ if (MEDIUM_USERNAME !== undefined) {
151159
.catch(error => {
152160
console.error("Error:", error);
153161
});
154-
}
162+
}

0 commit comments

Comments
 (0)