wait for server before registering function
Change-Id: If2fd7c907c9e3bc1a2e779af9ae834d5a0d3bcc7
This commit is contained in:
parent
bcd886edc3
commit
b7d1dc6228
@ -47,6 +47,7 @@ class ZuulManager(threading.Thread):
|
|||||||
self.config['zuul_server']['gearman_host'],
|
self.config['zuul_server']['gearman_host'],
|
||||||
self.config['zuul_server']['gearman_port']
|
self.config['zuul_server']['gearman_port']
|
||||||
)
|
)
|
||||||
|
self.gearman_worker.waitForServer()
|
||||||
self.gearman_worker.registerFunction(
|
self.gearman_worker.registerFunction(
|
||||||
'stop:turbo-hipster-manager-%s' % hostname)
|
'stop:turbo-hipster-manager-%s' % hostname)
|
||||||
|
|
||||||
@ -118,6 +119,7 @@ class ZuulClient(threading.Thread):
|
|||||||
def register_functions(self):
|
def register_functions(self):
|
||||||
self.log.debug("Register functions with gearman")
|
self.log.debug("Register functions with gearman")
|
||||||
for function_name, plugin in self.functions.items():
|
for function_name, plugin in self.functions.items():
|
||||||
|
self.gearman_worker.waitForServer()
|
||||||
self.gearman_worker.registerFunction(function_name)
|
self.gearman_worker.registerFunction(function_name)
|
||||||
self.log.debug(self.gearman_worker.functions)
|
self.log.debug(self.gearman_worker.functions)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user