diff options
author | Joseph C Wang <joequant@gmail.com> | 2020-04-08 06:25:41 +0300 |
---|---|---|
committer | Joseph C Wang <joequant@gmail.com> | 2020-04-08 06:28:26 +0300 |
commit | 5bace2e02910c1c76018d5e2f2c7b4b1f1c953d1 (patch) | |
tree | c17596873fb7924f5a8f470ae10654aee9480370 | |
parent | d6a76d2ceae02f3c2cee087971147ee14e4ba0ef (diff) |
reduce expired timeout to commit changes faster
This reduces the timeout to mark a page inactive from 100 seconds to
15 seconds. This allows for saved pages to be committed more quickly.
Addresses issues in nextcloud/documentserver_community#100
Signed-off-by: Joseph C Wang <joequant@gmail.com>
-rw-r--r-- | lib/Channel/SessionManager.php | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/Channel/SessionManager.php b/lib/Channel/SessionManager.php index 7fa0365..f93cd42 100644 --- a/lib/Channel/SessionManager.php +++ b/lib/Channel/SessionManager.php @@ -27,6 +27,7 @@ use OCP\DB\QueryBuilder\IQueryBuilder; use OCP\IDBConnection; class SessionManager { + const EXPIRED_SESSION_TIMEOUT = 15; private $connection; private $timeFactory; private $ipcFactory; @@ -127,7 +128,8 @@ class SessionManager { private function getExpiredSessions(): array { $query = $this->connection->getQueryBuilder(); - $cutoffTime = $this->timeFactory->getTime() - (Channel::TIMEOUT * 4); + $cutoffTime = $this->timeFactory->getTime() - + EXPIRED_SESSION_TIMEOUT; $query->select('session_id') ->from('documentserver_sess') |