Skip to content

Commit

Permalink
Skip negative sleep
Browse files Browse the repository at this point in the history
  • Loading branch information
pieterbrandsen authored Mar 18, 2024
1 parent c6e0214 commit 4134e24
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/process/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ async function waitMax500ms(proxyIndex = -1) {
const diff = Date.now() - last;
lastRequest[proxyIndex] = Date.now();
const sleepTime = Math.min(500 - diff, 500);
if (sleepTime < 0) Promise.resolve();
if (sleepTime < 0) return Promise.resolve();
return sleep(sleepTime);
}

Expand Down

0 comments on commit 4134e24

Please sign in to comment.