Skip to content

Commit c727ead

Browse files
committed
fix: prevent ttl being a negative number (and therefore in the future)
1 parent 13e9403 commit c727ead

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Repository/JobLogRepository.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -162,11 +162,11 @@ public function findJobLog(string $uuid): ?JobLog
162162
}
163163

164164
/**
165-
* Removes all jobs older than ($this->ttl - 86400 seconds) from all secondary indexes
165+
* Removes all jobs older than ($this->ttl) from all secondary indexes
166166
*/
167167
public function removeExpiredJobs(): void
168168
{
169-
$interval = new \DateInterval(sprintf('PT%sS', $this->ttl - 86400));
169+
$interval = new \DateInterval(sprintf('PT%sS', $this->ttl));
170170
$before = (new \DateTime('now'))->sub($interval)->format('U');
171171

172172
$qb = $this->getEntityManager()->createQueryBuilder();

0 commit comments

Comments
 (0)