summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2012-04-17 09:07:57 (GMT)
committerJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2012-04-17 09:07:57 (GMT)
commit1462a29b9667af47c587e2b90648ed4106e53b7c (patch)
tree35ff5de7f17aad9ce70806155d1d375d16ee1794
parent3527dc014a687c16c3794fcdb20c7e5f076f450f (diff)
downloadpykolab-1462a29b9667af47c587e2b90648ed4106e53b7c.tar.gz
Prevent kolabd from having started too early, and not being able to connect to Cyrus IMAP, from defuncting the entire daemon
-rw-r--r--pykolab/imap/cyrus.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/pykolab/imap/cyrus.py b/pykolab/imap/cyrus.py
index 2dcb5ad..1d5b9b4 100644
--- a/pykolab/imap/cyrus.py
+++ b/pykolab/imap/cyrus.py
@@ -72,7 +72,13 @@ class Cyrus(cyruslib.CYRUS):
self.uri = "%s://%s:%s" % (scheme,hostname,port)
- cyruslib.CYRUS.__init__(self, self.uri)
+ while 1:
+ try:
+ cyruslib.CYRUS.__init__(self, self.uri)
+ break
+ except cyruslib.CYRUSError:
+ log.warning(_("Could not connect to Cyrus IMAP server %r") % (self.uri))
+ time.sleep(10)
if conf.debuglevel > 8:
self.VERBOSE = True