From c3895990c55f6aebb5e28066764879f3eb2bb3ff Mon Sep 17 00:00:00 2001 From: Arthur Schiwon Date: Mon, 1 Jul 2024 13:37:06 +0200 Subject: [PATCH] fix(BuildSocialSearchIndexBackgroundJob): offset not applied with more than 100 results, this job may never finish Signed-off-by: Arthur Schiwon --- apps/dav/lib/Migration/BuildSocialSearchIndexBackgroundJob.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/apps/dav/lib/Migration/BuildSocialSearchIndexBackgroundJob.php b/apps/dav/lib/Migration/BuildSocialSearchIndexBackgroundJob.php index 231749521be..05ad95c595c 100644 --- a/apps/dav/lib/Migration/BuildSocialSearchIndexBackgroundJob.php +++ b/apps/dav/lib/Migration/BuildSocialSearchIndexBackgroundJob.php @@ -26,6 +26,7 @@ use OC\BackgroundJob\QueuedJob; use OCA\DAV\CardDAV\CardDavBackend; use OCP\AppFramework\Utility\ITimeFactory; use OCP\BackgroundJob\IJobList; +use OCP\DB\QueryBuilder\IQueryBuilder; use OCP\IDBConnection; use OCP\ILogger; @@ -98,6 +99,7 @@ class BuildSocialSearchIndexBackgroundJob extends QueuedJob { ->from('cards', 'c') ->orderBy('id', 'ASC') ->where($query->expr()->like('carddata', $query->createNamedParameter('%SOCIALPROFILE%'))) + ->andWhere($query->expr()->gt('id', $query->createNamedParameter((int)$offset, IQueryBuilder::PARAM_INT))) ->setMaxResults(100); $social_cards = $query->execute()->fetchAll();