diff options
author | Robin Appelman <icewind@owncloud.com> | 2013-04-20 23:27:46 +0200 |
---|---|---|
committer | Robin Appelman <icewind@owncloud.com> | 2013-04-20 23:27:46 +0200 |
commit | 7948341a86fb08d236bb53f8aece809ae10ba5f2 (patch) | |
tree | 61bf8cc11b2212953f5f87216d33a7744869385f /cron.php | |
parent | d0a5fe1f4a39f21c596293232be19d70ad30652e (diff) | |
download | nextcloud-server-7948341a86fb08d236bb53f8aece809ae10ba5f2.tar.gz nextcloud-server-7948341a86fb08d236bb53f8aece809ae10ba5f2.zip |
Rework background job system
Diffstat (limited to 'cron.php')
-rw-r--r-- | cron.php | 11 |
1 files changed, 9 insertions, 2 deletions
@@ -94,7 +94,11 @@ if (OC::$CLI) { touch(TemporaryCronClass::$lockfile); // Work - OC_BackgroundJob_Worker::doAllSteps(); + $jobList = new \OC\BackgroundJob\JobList(); + $jobs = $jobList->getAll(); + foreach ($jobs as $job) { + $job->execute($jobList); + } } else { // We call cron.php from some website if ($appmode == 'cron') { @@ -102,7 +106,10 @@ if (OC::$CLI) { OC_JSON::error(array('data' => array('message' => 'Backgroundjobs are using system cron!'))); } else { // Work and success :-) - OC_BackgroundJob_Worker::doNextStep(); + $jobList = new \OC\BackgroundJob\JobList(); + $job = $jobList->getNext(); + $job->execute($jobList); + $jobList->setLastJob($job); OC_JSON::success(); } } |