diff options
author | Arthur Schiwon <blizzz@owncloud.com> | 2012-08-22 12:04:32 +0200 |
---|---|---|
committer | Arthur Schiwon <blizzz@owncloud.com> | 2012-08-22 12:44:46 +0200 |
commit | 63c454c7b26b36060a170ef74f19b2fd65310879 (patch) | |
tree | 58eaa778822c13abdfee8a99d0354d4ed2f132f4 /apps | |
parent | 056d9adb238ee4619bd44ca6db54f6010463858c (diff) | |
download | nextcloud-server-63c454c7b26b36060a170ef74f19b2fd65310879.tar.gz nextcloud-server-63c454c7b26b36060a170ef74f19b2fd65310879.zip |
LDAP: make refreshInterval for background jobs configurable in the DB
Diffstat (limited to 'apps')
-rw-r--r-- | apps/user_ldap/lib/jobs.php | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/apps/user_ldap/lib/jobs.php b/apps/user_ldap/lib/jobs.php index ff28d86cfe8..d478731b84c 100644 --- a/apps/user_ldap/lib/jobs.php +++ b/apps/user_ldap/lib/jobs.php @@ -24,10 +24,6 @@ namespace OCA\user_ldap\lib; class Jobs { - - //refresh groups every hour - static private $refreshInterval = 3600; - static private $groupsFromDB; static private $groupBE; @@ -36,7 +32,7 @@ class Jobs { static public function updateGroups() { \OCP\Util::writeLog('user_ldap', 'Run background job "updateGroups"', \OCP\Util::DEBUG); $lastUpdate = \OCP\Config::getAppValue('user_ldap', 'bgjUpdateGroupsLastRun', 0); - if((time() - $lastUpdate) < self::$refreshInterval) { + if((time() - $lastUpdate) < self::getRefreshInterval()) { \OCP\Util::writeLog('user_ldap', 'bgJ "updateGroups" – last run too fresh, aborting.', \OCP\Util::DEBUG); //komm runter Werner die Maurer geben ein aus return; @@ -60,6 +56,11 @@ class Jobs { \OCP\Util::writeLog('user_ldap', 'bgJ "updateGroups" – Finished.', \OCP\Util::DEBUG); } + static private function getRefreshInterval() { + //defaults to every hour + return \OCP\Config::getAppValue('user_ldap', 'bgjRefreshInterval', 3600); + } + static private function handleKnownGroups($groups) { \OCP\Util::writeLog('user_ldap', 'bgJ "updateGroups" – Dealing with known Groups.', \OCP\Util::DEBUG); $query = \OCP\DB::prepare(' |