From 2bd65231368191639f65306447fa775ecbef4fab Mon Sep 17 00:00:00 2001 From: =?utf8?q?Julius=20H=C3=A4rtl?= Date: Mon, 30 May 2022 18:01:51 +0200 Subject: [PATCH] Cleanup tempfiles after each cron job run MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Julius Härtl --- cron.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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; -- 2.39.5