Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Retry init.

  • Loading branch information...
commit 313dd3a0c3dfd0b6991927ee41bb28707c46a140 1 parent a9bceba
@Stebalien Stebalien authored
Showing with 9 additions and 1 deletion.
  1. +9 −1 zserv/zserv/xmlrpc.py
View
10 zserv/zserv/xmlrpc.py
@@ -10,6 +10,7 @@
import settings
from exceptions import ServerKilled
import inspect
+from time import sleep
logger = logging.getLogger("xmlrpc")
@@ -41,7 +42,13 @@ def __init__(self,
self.keyfile = keyfile
self.certfile = certfile
super(ZephyrXMLRPCServer, self).__init__((host, port), allow_none=True, requestHandler=ZephyrXMLRPCRequestHandler)
- zephyr.init()
+
+ try:
+ zephyr.init()
+ except IOError:
+ sleep(1)
+ zephyr.init()
+
self.username = zephyr.sender()
self.preferences = exported(preferences.Preferences())
self.subscriptions = exported(SubscriptionManager(self.username))
@@ -83,6 +90,7 @@ def _dispatch(self, method, params):
return obj(*params)
except Exception as e:
logging.getLogger(getattr(inspect.getmodule(inspect.trace()[-1]), "__name__", __name__)).debug("%s: %s" % (e.__class__.__name__, e.message))
+ raise e
except KeyboardInterrupt:
raise ServerKilled()
Please sign in to comment.
Something went wrong with that request. Please try again.