Skip to content
Merged
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,13 @@ public function execute()
parent::execute();

for ($i = 0; $i < self::$jobsPerRun; $i++) {
// Reset the memory usage for each background job, allowing to measure each individual
// background job's memory usage without a memory-heavy job skewing the numbers for
// the following jobs.
if (\PHP_VERSION_ID >= 80200) {
\memory_reset_peak_usage();
}

if (BackgroundQueueHandler::getInstance()->performNextJob() === false) {
// there were no more jobs
break;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,13 @@ public function executeCronjobs()
SessionHandler::getInstance()->changeUser(new User(null), true);

foreach ($cronjobEditors as $cronjobEditor) {
// Reset the memory usage for each cronjob, allowing to measure each individual
// cronjob's memory usage without a memory-heavy cronjob skewing the numbers for
// the following cronjobs.
if (\PHP_VERSION_ID >= 80200) {
\memory_reset_peak_usage();
}

// mark cronjob as being executed
$cronjobEditor->update([
'state' => Cronjob::EXECUTING,
Expand Down
Loading