fix(BuildSocialSearchIndexBackgroundJob): offset not applied

with more than 100 results, this job may never finish

Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
This commit is contained in:
Arthur Schiwon 2024-07-01 13:37:06 +02:00
parent db5fbe46ab
commit c3895990c5
No known key found for this signature in database
GPG key ID: 7424F1874854DF23

View file

@ -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();