diff options
author | Josh <josh.t.richards@gmail.com> | 2024-05-27 09:19:48 -0400 |
---|---|---|
committer | Josh <josh.t.richards@gmail.com> | 2024-06-27 17:07:58 -0400 |
commit | 92fce667508abc5ac6a744094b41a315cd85eb85 (patch) | |
tree | f91451c8bce6ed4f71e6ef8391838ca9ab4d6849 /cron.php | |
parent | 24d88615d0fa926239cd7dbc9a0f5f66c419bf1c (diff) | |
download | nextcloud-server-92fce667508abc5ac6a744094b41a315cd85eb85.tar.gz nextcloud-server-92fce667508abc5ac6a744094b41a315cd85eb85.zip |
fix(cron): Log excess memory usage at debug and info levels
Signed-off-by: Josh <josh.t.richards@gmail.com>
Diffstat (limited to 'cron.php')
-rw-r--r-- | cron.php | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -197,10 +197,10 @@ try { ); } - 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']); + if ($memoryAfter - $memoryBefore > 50_000_000) { + $logger->warning('Used memory grew by more than 50 MB when executing job ' . $jobDetails . ': ' . Util::humanFileSize($memoryAfter). ' (before: ' . Util::humanFileSize($memoryBefore) . ')', ['app' => 'cron']); } - if ($memoryPeakAfter > 300_000_000) { + if ($memoryPeakAfter > 300_000_000 && $memoryPeakBefore <= 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']); } |