Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
update Warn on excessive memory consumption in background jobs to Info
Signed-off-by: Andy Xheli <[email protected]>

Fix 

[Bug]: Change Warn on excessive memory consumption in background jobs to info #45682

Signed-off-by: Andy Xheli <[email protected]>
  • Loading branch information
AndyXheli authored Jun 5, 2024
commit e71d16d6da8c5a7fe72d54264ebb511a5f4166d5
4 changes: 2 additions & 2 deletions cron.php
Original file line number Diff line number Diff line change
Expand Up @@ -164,10 +164,10 @@
$memoryPeakAfter = memory_get_peak_usage();

if ($memoryAfter - $memoryBefore > 10_000_000) {
$logger->warning('Used memory grew by more than 10 MB when executing job ' . $jobDetails . ': ' . Util::humanFileSize($memoryAfter). ' (before: ' . Util::humanFileSize($memoryBefore) . ')', ['app' => 'cron']);
$logger->info('Used memory grew by more than 10 MB when executing job ' . $jobDetails . ': ' . Util::humanFileSize($memoryAfter). ' (before: ' . Util::humanFileSize($memoryBefore) . ')', ['app' => 'cron']);
}
if ($memoryPeakAfter > 300_000_000) {
$logger->warning('Cron job used more than 300 MB of ram after executing job ' . $jobDetails . ': ' . Util::humanFileSize($memoryPeakAfter) . ' (before: ' . Util::humanFileSize($memoryPeakBefore) . ')', ['app' => 'cron']);
$logger->info('Cron job used more than 300 MB of ram after executing job ' . $jobDetails . ': ' . Util::humanFileSize($memoryPeakAfter) . ' (before: ' . Util::humanFileSize($memoryPeakBefore) . ')', ['app' => 'cron']);
}

// clean up after unclean jobs
Expand Down