summaryrefslogtreecommitdiffstats
path: root/lib/base.php
diff options
context:
space:
mode:
authorBart Visscher <bartv@thisnet.nl>2013-07-10 18:07:43 +0200
committerBart Visscher <bartv@thisnet.nl>2013-08-28 17:11:43 +0200
commit42f3ecb60fb14ef9739b436f115d302b5d4432a1 (patch)
tree6692b5f4d787309a23c220bd104754aa2a904932 /lib/base.php
parent62560ef859a459542af50dd1905bdf8828a1d142 (diff)
downloadnextcloud-server-42f3ecb60fb14ef9739b436f115d302b5d4432a1.tar.gz
nextcloud-server-42f3ecb60fb14ef9739b436f115d302b5d4432a1.zip
Check for installed state before registering the logrotate background job
Diffstat (limited to 'lib/base.php')
-rw-r--r--lib/base.php16
1 files changed, 15 insertions, 1 deletions
diff --git a/lib/base.php b/lib/base.php
index 22aed1c5664..f45012bb83c 100644
--- a/lib/base.php
+++ b/lib/base.php
@@ -491,7 +491,7 @@ class OC {
self::registerCacheHooks();
self::registerFilesystemHooks();
self::registerShareHooks();
- \OCP\BackgroundJob::registerJob('OC\Log\Rotate', OC_Config::getValue("datadirectory", OC::$SERVERROOT.'/data').'/owncloud.log');
+ self::registerLogRotate();
//make sure temporary files are cleaned up
register_shutdown_function(array('OC_Helper', 'cleanTmp'));
@@ -554,6 +554,20 @@ class OC {
}
/**
+ * register hooks for the cache
+ */
+ public static function registerLogRotate() {
+ if (OC_Config::getValue('installed', false)) { //don't try to do this before we are properly setup
+ // register cache cleanup jobs
+ try { //if this is executed before the upgrade to the new backgroundjob system is completed it will throw an exception
+ \OCP\BackgroundJob::registerJob('OC\Log\Rotate', OC_Config::getValue("datadirectory", OC::$SERVERROOT.'/data').'/owncloud.log');
+ } catch (Exception $e) {
+
+ }
+ }
+ }
+
+ /**
* register hooks for the filesystem
*/
public static function registerFilesystemHooks() {