diff options
author | Vincent Petry <vincent@nextcloud.com> | 2022-05-31 09:19:31 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-05-31 09:19:31 +0200 |
commit | cf9d0b123a8947309febe932aa75b4036d69482f (patch) | |
tree | daffd870a1b8c970b324cdf798b2efabfd1a059d | |
parent | eca5e2dce10738317a0ff46a8d3fa1530b623b95 (diff) | |
parent | c8a6dad51919904f7e8f9998011cf4f00cfa4648 (diff) | |
download | nextcloud-server-cf9d0b123a8947309febe932aa75b4036d69482f.tar.gz nextcloud-server-cf9d0b123a8947309febe932aa75b4036d69482f.zip |
Merge pull request #32663 from nextcloud/bugfix/noid/temp-cron
Cleanup tempfiles after each cron job run
-rw-r--r-- | cron.php | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -64,13 +64,14 @@ try { $logger = \OC::$server->getLogger(); $config = \OC::$server->getConfig(); + $tempManager = \OC::$server->getTempManager(); // Don't do anything if Nextcloud has not been installed if (!$config->getSystemValue('installed', false)) { exit(0); } - \OC::$server->getTempManager()->cleanOld(); + $tempManager->cleanOld(); // Exit if background jobs are disabled! $appMode = $config->getAppValue('core', 'backgroundjobs_mode', 'ajax'); @@ -149,8 +150,10 @@ try { $logger->debug('CLI cron call has selected job with ID ' . strval($job->getId()), ['app' => 'cron']); $job->execute($jobList, $logger); + // clean up after unclean jobs \OC_Util::tearDownFS(); + $tempManager->clean(); $jobList->setLastJob($job); $executedJobs[$job->getId()] = true; |