Skip to content

Commit

Permalink
fixed handling QueueMonitor.purgeLogsOlderThanDays in Purge command
Browse files Browse the repository at this point in the history
  • Loading branch information
arusinowski committed Oct 30, 2024
1 parent 1dc7b9d commit 94f163a
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/Command/PurgeCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,18 +73,20 @@ public function execute(Arguments $args, ConsoleIo $io)
return self::CODE_SUCCESS;
}

$purgeLogsOlderThanDays = (int)Configure::read(
'QueueMonitor.purgeLogsOlderThanDays',
self::DEFAULT_PURGE_DAYS_OLD
);

$purgeToDate = $this->queueMonitoringService->getPurgeToDate(
(int)Configure::read(
'QueueMonitor.purgeLogsOlderThanDays',
self::DEFAULT_PURGE_DAYS_OLD
)
$purgeLogsOlderThanDays
);
$this->log(
"Purging queue logs older than {$purgeToDate->toDateTimeString()} UTC",
LogLevel::INFO
);
try {
$rowCount = $this->queueMonitoringService->purgeLogs(self::DEFAULT_PURGE_DAYS_OLD);
$rowCount = $this->queueMonitoringService->purgeLogs($purgeLogsOlderThanDays);
$this->log(
"Purged $rowCount queue messages older than {$purgeToDate->toDateTimeString()} UTC",
LogLevel::INFO
Expand Down

0 comments on commit 94f163a

Please sign in to comment.