summaryrefslogtreecommitdiffstats
path: root/kolabd
diff options
context:
space:
mode:
authorJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2013-04-29 13:34:17 +0200
committerJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2013-04-29 13:34:17 +0200
commite0835ed698888cebf0ff84e1c6c67e98f9eb5d8f (patch)
tree0b1354c7a9fb1f93ff09f25de9f9b59dafb2c23f /kolabd
parent99a3ed7fdf4476a78aed722329bb874fc8b4ad06 (diff)
downloadpykolab-e0835ed698888cebf0ff84e1c6c67e98f9eb5d8f.tar.gz
Add a [kolab] section setting 'sync_interval', used as the interval between authn/authz synchronization calls.
Synchronization would otherwise continue to occur with paged searches, or vlv searches, immediately after finishing a run.
Diffstat (limited to 'kolabd')
-rw-r--r--kolabd/process.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/kolabd/process.py b/kolabd/process.py
index 6578151..659b74f 100644
--- a/kolabd/process.py
+++ b/kolabd/process.py
@@ -38,11 +38,19 @@ class KolabdProcess(multiprocessing.Process):
)
def synchronize(self, domain):
+ sync_interval = conf.get('kolab', 'sync_interval')
+
+ if sync_interval == None or sync_interval == 0:
+ sync_interval = 300
+ else:
+ sync_interval = (int)(sync_interval)
+
while True:
try:
auth = Auth(domain)
auth.connect(domain)
auth.synchronize()
+ time.sleep(sync_interval)
except KeyboardInterrupt:
break
except Exception, errmsg: