summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVincent Petry <vincent@nextcloud.com>2022-05-31 09:19:31 +0200
committerGitHub <noreply@github.com>2022-05-31 09:19:31 +0200
commitcf9d0b123a8947309febe932aa75b4036d69482f (patch)
treedaffd870a1b8c970b324cdf798b2efabfd1a059d
parenteca5e2dce10738317a0ff46a8d3fa1530b623b95 (diff)
parentc8a6dad51919904f7e8f9998011cf4f00cfa4648 (diff)
downloadnextcloud-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.php5
1 files changed, 4 insertions, 1 deletions
diff --git a/cron.php b/cron.php
index a58ef2c206f..7d661621ed0 100644
--- a/cron.php
+++ b/cron.php
@@ -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;