From: Bill Erickson Date: Thu, 31 May 2018 19:23:12 +0000 (-0400) Subject: LP#1626157 x-port LP#1774448 auth polling fix X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=3902daa8623cc0efe3bba22faa6ad9345cc212d3;p=working%2FEvergreen.git LP#1626157 x-port LP#1774448 auth polling fix Signed-off-by: Bill Erickson --- diff --git a/Open-ILS/src/eg2/src/app/core/auth.service.ts b/Open-ILS/src/eg2/src/app/core/auth.service.ts index 6c3ef9156f..b6608567af 100644 --- a/Open-ILS/src/eg2/src/app/core/auth.service.ts +++ b/Open-ILS/src/eg2/src/app/core/auth.service.ts @@ -214,7 +214,16 @@ export class EgAuthService { // add a 5 second delay to give the token plenty of time // to expire on the server. - const pollTime = this.authtime() * 1000 + 5000; + let pollTime = this.authtime() * 1000 + 5000; + + if (pollTime < 60000) { + // Never poll more often than once per minute. + pollTime = 60000; + } else if (pollTime > 2147483647) { + // Avoid integer overflow resulting in $timeout() effectively + // running with timeout=0 in a loop. + pollTime = 2147483647; + } this.pollTimeout = setTimeout(() => { this.net.request(