summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2012-12-26 17:26:00 +0100
committerJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2012-12-26 17:26:00 +0100
commit7099803125af47ce2ddaf1da4159d1930a2eabf3 (patch)
treead33f4ab12042beaf14de0313a909f6091446d16
parent8c726c54842e69426eb6d689ea6317eef91af61c (diff)
downloadpykolab-7099803125af47ce2ddaf1da4159d1930a2eabf3.tar.gz
Continuously loop through the synchronization, sleeping 1 second each run - except when a keyboard interrupt is issued
-rw-r--r--kolabd/process.py19
1 files changed, 12 insertions, 7 deletions
diff --git a/kolabd/process.py b/kolabd/process.py
index ddaac63..30b5065 100644
--- a/kolabd/process.py
+++ b/kolabd/process.py
@@ -37,10 +37,15 @@ class KolabdProcess(multiprocessing.Process):
)
def synchronize(self, domain):
- try:
- auth = Auth(domain)
- auth.connect(domain)
- auth.synchronize()
- except:
- log.error(_("Error in process %r, terminating") % (self.name))
- return \ No newline at end of file
+ while True:
+ try:
+ auth = Auth(domain)
+ auth.connect(domain)
+ auth.synchronize()
+ except KeyboardInterrupt:
+ break
+ except Exception, errmsg:
+ log.error(_("Error in process %r, terminating: %r") % (self.name, errmsg))
+ import traceback
+ traceback.print_exc()
+ time.sleep(1)