aboutsummaryrefslogtreecommitdiffstats
path: root/cron.php
diff options
context:
space:
mode:
authorJulius Härtl <jus@bitgrid.net>2022-05-30 18:01:51 +0200
committerJulius Härtl <jus@bitgrid.net>2022-05-30 18:01:51 +0200
commitc8a6dad51919904f7e8f9998011cf4f00cfa4648 (patch)
tree4bee0943a418f578bc917a7f665bf7f61134e364 /cron.php
parent7140201a322d5be30e899143a0482aaba05b7ade (diff)
downloadnextcloud-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.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;