From ecadbb3433dd96b1fff7d533e92dbfa46c04e910 Mon Sep 17 00:00:00 2001 From: Bill Erickson Date: Thu, 31 May 2018 15:23:12 -0400 Subject: [PATCH] LP#1775466 x-port LP#1774448 auth polling fix Signed-off-by: Bill Erickson --- Open-ILS/src/eg2/src/app/core/auth.service.ts | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) 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( -- 2.11.0