Skip to content
This repository has been archived by the owner on Oct 10, 2022. It is now read-only.

Enable no-await-in-loops ESLint rule #250

Merged
merged 1 commit into from
Dec 20, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ module.exports = {
complexity: 0,
'max-nested-callbacks': 0,
'max-statements': 0,
'no-await-in-loop': 0,
'fp/no-class': 0,
'fp/no-let': 0,
'fp/no-loops': 0,
Expand Down
2 changes: 2 additions & 0 deletions src/methods/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,11 @@ const addAgent = function (agent, opts) {
const makeRequestOrRetry = async function ({ url, method, defaultHeaders, agent, requestParams, opts }) {
for (let index = 0; index <= MAX_RETRY; index++) {
const optsA = getOpts({ method, defaultHeaders, agent, requestParams, opts })
// eslint-disable-next-line no-await-in-loop
const { response, error } = await makeRequest(url, optsA)

if (shouldRetry({ response, error }) && index !== MAX_RETRY) {
// eslint-disable-next-line no-await-in-loop
await waitForRetry(response)
continue
}
Expand Down