Fixed KeepAlive issue where too large of a session value would fire the keep alive immediately (fixes #1860)

This commit is contained in:
Djamil Legato
2020-11-20 17:27:01 -08:00
parent ee67dddd8d
commit bd87db1931
3 changed files with 5 additions and 2 deletions

View File

@@ -21,6 +21,7 @@
* Fixed folder auto-naming in Add Module [#1937](https://github.com/getgrav/grav-plugin-admin/issues/1937)
* Fixed remodal issue triggering close when selecting a dropdown item ending outside of scope [#1682](https://github.com/getgrav/grav-plugin-admin/issues/1682)
* Reworked how collapsed lists work so the tooltip is not cut off [#1928](https://github.com/getgrav/grav-plugin-admin/issues/1928)
* Fixed KeepAlive issue where too large of a session value would fire the keep alive immediately [#1860](https://github.com/getgrav/grav-plugin-admin/issues/1860)
# v1.10.0-rc.17
## 10/07/2020

View File

@@ -1,6 +1,8 @@
import { config } from 'grav-config';
import { userFeedbackError } from './response';
const MAX_SAFE_DELAY = 2147483647;
class KeepAlive {
constructor() {
this.active = false;
@@ -8,7 +10,7 @@ class KeepAlive {
start() {
let timeout = config.admin_timeout / 1.5 * 1000;
this.timer = setInterval(() => this.fetch(), timeout);
this.timer = setInterval(() => this.fetch(), Math.min(timeout, MAX_SAFE_DELAY));
this.active = true;
}

File diff suppressed because one or more lines are too long