[open-ils-commits] [GIT] Evergreen ILS branch rel_3_1 updated. e112c316136a6068effa549b6aaff4e1113b2796

Evergreen Git git at git.evergreen-ils.org
Wed Aug 22 12:22:26 EDT 2018


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Evergreen ILS".

The branch, rel_3_1 has been updated
       via  e112c316136a6068effa549b6aaff4e1113b2796 (commit)
      from  dcd4c6a88e0518010c9afc3619fe9fa44dab3b48 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit e112c316136a6068effa549b6aaff4e1113b2796
Author: Bill Erickson <berickxx at gmail.com>
Date:   Thu May 31 15:12:55 2018 -0400

    LP#1774448 Auth poll spam/timing repairs
    
    Avoid spamming the server with authentication session checks on bad poll
    time values.  Specifically, never poll more often than once per minute
    and avoid integer overflow on long authentication timeout values
    (greater than about 24.8 days) resulting in the poll running with an
    effective timeout of zero and spamming the server with API calls.
    
    Signed-off-by: Bill Erickson <berickxx at gmail.com>
    Signed-off-by: Jason Boyer <jboyer at library.in.gov>

diff --git a/Open-ILS/web/js/ui/default/staff/services/auth.js b/Open-ILS/web/js/ui/default/staff/services/auth.js
index b93b6b8..9048a34 100644
--- a/Open-ILS/web/js/ui/default/staff/services/auth.js
+++ b/Open-ILS/web/js/ui/default/staff/services/auth.js
@@ -286,6 +286,19 @@ function($q , $timeout , $rootScope , $window , $location , egNet , egHatch) {
             }
         }
 
+        // add a 5 second delay to give the token plenty of time
+        // to expire on the server.
+        var pollTime = service.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;
+        }
+
         $timeout(
             function() {
                 egNet.request(                                                     
@@ -304,9 +317,7 @@ function($q , $timeout , $rootScope , $window , $location , egNet , egHatch) {
                     }
                 })
             },
-            // add a 5 second delay to give the token plenty of time
-            // to expire on the server.
-            service.authtime() * 1000 + 5000
+            pollTime
         );
     }
 

-----------------------------------------------------------------------

Summary of changes:
 Open-ILS/web/js/ui/default/staff/services/auth.js |   17 ++++++++++++++---
 1 files changed, 14 insertions(+), 3 deletions(-)


hooks/post-receive
-- 
Evergreen ILS


More information about the open-ils-commits mailing list