Skip to content

Commit

Permalink
Merge pull request ccxt#14504 from ttodua/timeout-fix
Browse files Browse the repository at this point in the history
timeout fix
  • Loading branch information
kroitor authored Jul 27, 2022
2 parents b459dd7 + 08d0b59 commit 73890d5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions js/base/functions/time.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ const uuidv1 = () => {

const setTimeout_original = setTimeout;
const setTimeout_safe = (done, ms, setTimeout = setTimeout_original /* overrideable for mocking purposes */, targetTime = now () + ms) => {
// avoid MAX_INT issue https://stackoverflow.com/questions/60474110
// avoid MAX_INT issue https://github.com/ccxt/ccxt/issues/10761
if (ms >= 2147483647) {
throw new Exception ('setTimeout() function was called with unrealistic value of ' + ms.toString ());
throw new Error ('setTimeout() function was called with unrealistic value of ' + ms.toString ());
}
// The built-in setTimeout function can fire its callback earlier than specified, so we
// need to ensure that it does not happen: sleep recursively until `targetTime` is reached...
Expand Down

0 comments on commit 73890d5

Please sign in to comment.