mirror of
https://github.com/shlinkio/shlink.git
synced 2024-11-22 08:56:42 -06:00
Fixed warning displayed when trying to late visits and there are no pending
This commit is contained in:
parent
ebcf3e0119
commit
0f51b5b1ce
@ -70,15 +70,17 @@ class VisitRepository extends EntitySpecificationRepository implements VisitRepo
|
||||
$qb = (clone $originalQueryBuilder)->andWhere($qb->expr()->gt('v.id', $lastId));
|
||||
$iterator = $qb->getQuery()->toIterable();
|
||||
$resultsFound = false;
|
||||
/** @var Visit|null $lastProcessedVisit */
|
||||
$lastProcessedVisit = null;
|
||||
|
||||
foreach ($iterator as $key => $visit) {
|
||||
$resultsFound = true;
|
||||
$lastProcessedVisit = $visit;
|
||||
yield $key => $visit;
|
||||
}
|
||||
|
||||
// As the query is ordered by ID, we can take the last one every time in order to exclude the whole list
|
||||
/** @var Visit|null $visit */
|
||||
$lastId = $visit?->getId() ?? $lastId;
|
||||
$lastId = $lastProcessedVisit?->getId() ?? $lastId;
|
||||
} while ($resultsFound);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user