From 19192bb0376923062fcbeac3387718f7d1dedd2d 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 9a68897059702..9881d2903cbc5 100644 --- a/apps/dav/lib/Migration/BuildSocialSearchIndexBackgroundJob.php +++ b/apps/dav/lib/Migration/BuildSocialSearchIndexBackgroundJob.php @@ -30,6 +30,7 @@ use OCP\AppFramework\Utility\ITimeFactory; use OCP\BackgroundJob\IJobList; use OCP\BackgroundJob\QueuedJob; +use OCP\DB\QueryBuilder\IQueryBuilder; use OCP\IDBConnection; use Psr\Log\LoggerInterface; @@ -77,6 +78,7 @@ private function buildIndex($offset, $stopAt) { ->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->executeQuery()->fetchAll();