Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
fix(BuildSocialSearchIndexBackgroundJob): offset not applied
with more than 100 results, this job may never finish

Signed-off-by: Arthur Schiwon <[email protected]>
  • Loading branch information
blizzz authored and backportbot[bot] committed Jul 1, 2024
commit 19192bb0376923062fcbeac3387718f7d1dedd2d
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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)))

Check notice

Code scanning / Psalm

RedundantCastGivenDocblockType

Redundant cast to int given docblock-provided type
->setMaxResults(100);
$social_cards = $query->executeQuery()->fetchAll();

Expand Down