Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'cron.php')
-rw-r--r--cron.php13
1 files changed, 11 insertions, 2 deletions
diff --git a/cron.php b/cron.php
index afcf47cb0e9..73f233e1350 100644
--- a/cron.php
+++ b/cron.php
@@ -130,11 +130,20 @@ try {
// Work
$jobList = \OC::$server->getJobList();
- $jobs = $jobList->getAll();
- foreach ($jobs as $job) {
+
+ $executedJobs = [];
+ while ($job = $jobList->getNext()) {
+ if (isset($executedJobs[$job->getId()])) {
+ break;
+ }
+
$logger->debug('Run job with ID ' . $job->getId(), ['app' => 'cron']);
$job->execute($jobList, $logger);
$logger->debug('Finished job with ID ' . $job->getId(), ['app' => 'cron']);
+
+ $jobList->setLastJob($job);
+ $executedJobs[$job->getId()] = true;
+ unset($job);
}
// unlock the file