diff --git a/lib/Db/LocksRequest.php b/lib/Db/LocksRequest.php index 3948f0fc..bddcc0f0 100644 --- a/lib/Db/LocksRequest.php +++ b/lib/Db/LocksRequest.php @@ -124,8 +124,10 @@ public function getAll(): array { * @throws Exception */ public function getLocksOlderThan(int $timeout): array { + $now = \OC::$server->get(ITimeFactory::class)->getTime(); + $oldCreationTime = $now - $timeout * 60; $qb = $this->getLocksSelectSql(); - $qb->andWhere($qb->expr()->lt('l.creation', $qb->createNamedParameter($timeout * 60, IQueryBuilder::PARAM_INT))); + $qb->andWhere($qb->expr()->lt('l.creation', $qb->createNamedParameter($oldCreationTime, IQueryBuilder::PARAM_INT))); return $this->getLocksFromRequest($qb); }