Skip to content

Commit

Permalink
Merge pull request #364 from ZIMkaRU/feature/speed-up-auth-in-case-to…
Browse files Browse the repository at this point in the history
…ken-expiration

Speed up auth in case token expiration
  • Loading branch information
ezewer authored Apr 15, 2024
2 parents b7541dc + ee41a11 commit f26774c
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions workers/loc.api/helpers/get-data-from-api.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ const {
isRateLimitError,
isNonceSmallError,
isUserIsNotMerchantError,
isENetError
isENetError,
isAuthError
} = require('./api-errors-testers')

const _delay = (mc = 80000, interrupter) => {
Expand Down Expand Up @@ -161,7 +162,10 @@ module.exports = (
// Handle unexpected BFX API errors
countUnexpectedError += 1

if (countUnexpectedError > 3) {
if (
countUnexpectedError > 3 ||
isAuthError(err)
) {
throw err
}
if (_isInterrupted(_interrupter)) {
Expand Down

0 comments on commit f26774c

Please sign in to comment.