Signed-off-by: Bill Erickson <berickxx@gmail.com>
// 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(