summaryrefslogtreecommitdiffstats
path: root/cron.php
diff options
context:
space:
mode:
authorRobin Appelman <icewind@owncloud.com>2013-12-02 13:41:47 +0100
committerRobin Appelman <icewind@owncloud.com>2013-12-02 13:41:47 +0100
commit35bb6f7e3a4df325e594e1d206520e89014f2a42 (patch)
tree308e9dac501b7ed6ff50563bb553bbf052b80eb5 /cron.php
parentc2e83e635d0ad0fda4dbf9c89c06b45f59bc3b24 (diff)
downloadnextcloud-server-35bb6f7e3a4df325e594e1d206520e89014f2a42.tar.gz
nextcloud-server-35bb6f7e3a4df325e594e1d206520e89014f2a42.zip
Catch exceptions from background jobs and log them
Diffstat (limited to 'cron.php')
-rw-r--r--cron.php6
1 files changed, 4 insertions, 2 deletions
diff --git a/cron.php b/cron.php
index 8e1a3376d53..0d2c07b2d95 100644
--- a/cron.php
+++ b/cron.php
@@ -50,6 +50,8 @@ try {
session_write_close();
+ $logger = \OC_Log::$object;
+
// Don't do anything if ownCloud has not been installed
if (!OC_Config::getValue('installed', false)) {
exit(0);
@@ -98,7 +100,7 @@ try {
$jobList = new \OC\BackgroundJob\JobList();
$jobs = $jobList->getAll();
foreach ($jobs as $job) {
- $job->execute($jobList);
+ $job->execute($jobList, $logger);
}
} else {
// We call cron.php from some website
@@ -109,7 +111,7 @@ try {
// Work and success :-)
$jobList = new \OC\BackgroundJob\JobList();
$job = $jobList->getNext();
- $job->execute($jobList);
+ $job->execute($jobList, $logger);
$jobList->setLastJob($job);
OC_JSON::success();
}