wait for server before registering function

Change-Id: If2fd7c907c9e3bc1a2e779af9ae834d5a0d3bcc7
This commit is contained in:
Joshua Hesketh 2014-01-10 14:18:23 +08:00
parent bcd886edc3
commit b7d1dc6228

View File

@ -47,6 +47,7 @@ class ZuulManager(threading.Thread):
self.config['zuul_server']['gearman_host'],
self.config['zuul_server']['gearman_port']
)
self.gearman_worker.waitForServer()
self.gearman_worker.registerFunction(
'stop:turbo-hipster-manager-%s' % hostname)
@ -118,6 +119,7 @@ class ZuulClient(threading.Thread):
def register_functions(self):
self.log.debug("Register functions with gearman")
for function_name, plugin in self.functions.items():
self.gearman_worker.waitForServer()
self.gearman_worker.registerFunction(function_name)
self.log.debug(self.gearman_worker.functions)