Skip to content

Commit

Permalink
Merge pull request #21 from uafrica/better-archive
Browse files Browse the repository at this point in the history
Log the time for archive
  • Loading branch information
Johan Meiring committed Jun 15, 2018
2 parents 2534b69 + ae5e967 commit 4d71028
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/Worker/ArchiveWorker.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,10 @@ public function __invoke(Job $job)
Log::debug('Jobs deleted.');

if (Configure::read('DelayedJobs.archive.timeLimit')) {
Log::debug('Cleaning archive.');
$time = new Time('-' . Configure::read('DelayedJobs.archive.timeLimit'));
Log::debug('Cleaning archive. All jobs older than ' . $time);
$archiveTable->deleteAll([
'created <=' => new Time('-' . Configure::read('DelayedJobs.archive.timeLimit'))
'created <=' => $time
]);
Log::debug('Archive cleaned.');
}
Expand Down

0 comments on commit 4d71028

Please sign in to comment.