Skip to content

Commit

Permalink
feat: Added a feature to wait 5 minutes in case of a ban
Browse files Browse the repository at this point in the history
  • Loading branch information
Antabuse-123 committed Oct 19, 2024
1 parent d900be9 commit 3f0d03a
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions utils/curl.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,14 @@ const get = async (pathname, options) => {
await pause(5000)
}
if (statusCode === 404) logger.warn('404')
if (statusCode === 35)
{
logger.warn('SSL connect error, retrying')
// If this error happens, it means that we have been banned
// So we wait 5 minutes before retrying
// I added 10 seconds to be sure that the server is ready
await pause(1000 * 60 * 5 + 10000)
}
else logger.error('Error : ', statusCode)
throw { code: statusCode }
}
Expand Down

0 comments on commit 3f0d03a

Please sign in to comment.