aboutsummaryrefslogtreecommitdiffstats
path: root/cron.php
diff options
context:
space:
mode:
authorJosh <josh.t.richards@gmail.com>2024-05-27 09:19:48 -0400
committerJosh <josh.t.richards@gmail.com>2024-06-27 17:07:58 -0400
commit92fce667508abc5ac6a744094b41a315cd85eb85 (patch)
treef91451c8bce6ed4f71e6ef8391838ca9ab4d6849 /cron.php
parent24d88615d0fa926239cd7dbc9a0f5f66c419bf1c (diff)
downloadnextcloud-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.php6
1 files changed, 3 insertions, 3 deletions
diff --git a/cron.php b/cron.php
index 537201c1c28..4126200cc8e 100644
--- a/cron.php
+++ b/cron.php
@@ -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']);
}