From 1e59511d8dc94bc75416a5ef7ed2219bae30929b Mon Sep 17 00:00:00 2001 From: Carl Schwan Date: Wed, 13 Aug 2025 13:31:11 +0200 Subject: [PATCH] perf: Don't call twice the same query Find entities will execute the query already, there is no need to do it twice. Signed-off-by: Carl Schwan --- lib/Db/SessionMapper.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/Db/SessionMapper.php b/lib/Db/SessionMapper.php index 186f81929..15edd12e7 100644 --- a/lib/Db/SessionMapper.php +++ b/lib/Db/SessionMapper.php @@ -45,8 +45,7 @@ class SessionMapper extends QBMapper { $qb->select('id', 'board_id', 'last_contact', 'user_id', 'token') ->from($this->getTableName()) ->where($qb->expr()->eq('board_id', $qb->createNamedParameter($boardId))) - ->andWhere($qb->expr()->gt('last_contact', $qb->createNamedParameter(time() - SessionService::SESSION_VALID_TIME))) - ->executeQuery(); + ->andWhere($qb->expr()->gt('last_contact', $qb->createNamedParameter(time() - SessionService::SESSION_VALID_TIME))); return $this->findEntities($qb); }