chore: add inline documentation
This commit is contained in:
@@ -98,7 +98,9 @@ class TravelSnapshotRepository extends ServiceEntityRepository
|
||||
int $limit,
|
||||
): array {
|
||||
return $this->createQueryBuilder('s')
|
||||
// dateTo IS NULL: snapshots without a known end date are always considered active.
|
||||
->where('s.dateTo IS NULL OR s.dateTo >= :dateToThreshold')
|
||||
// extendedRefreshedAt IS NULL: never-refreshed snapshots rank as oldest.
|
||||
->andWhere('s.extendedRefreshedAt IS NULL OR s.extendedRefreshedAt < :refreshBefore')
|
||||
->setParameter('dateToThreshold', $dateToThreshold)
|
||||
->setParameter('refreshBefore', $refreshBefore)
|
||||
@@ -116,6 +118,8 @@ class TravelSnapshotRepository extends ServiceEntityRepository
|
||||
{
|
||||
return (int) $this->createQueryBuilder('s')
|
||||
->delete()
|
||||
// Snapshots with no known end date are excluded from purging as a safety net;
|
||||
// they must be cleaned up manually if they become stale.
|
||||
->where('s.dateTo IS NOT NULL')
|
||||
->andWhere('s.dateTo < :beforeDate')
|
||||
->setParameter('beforeDate', $beforeDate)
|
||||
|
||||
Reference in New Issue
Block a user