diff options
author | Julius Härtl <jus@bitgrid.net> | 2022-05-30 18:01:51 +0200 |
---|---|---|
committer | Julius Härtl <jus@bitgrid.net> | 2022-05-30 18:01:51 +0200 |
commit | c8a6dad51919904f7e8f9998011cf4f00cfa4648 (patch) | |
tree | 4bee0943a418f578bc917a7f665bf7f61134e364 /cron.php | |
parent | 7140201a322d5be30e899143a0482aaba05b7ade (diff) | |
download | nextcloud-server-c8a6dad51919904f7e8f9998011cf4f00cfa4648.tar.gz nextcloud-server-c8a6dad51919904f7e8f9998011cf4f00cfa4648.zip |
Cleanup tempfiles after each cron job run
Signed-off-by: Julius Härtl <jus@bitgrid.net>
Diffstat (limited to 'cron.php')
-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; |