Browse Source

Register merge jobs before starting the worker

It's possible gear doesn't deal with this case gracefully.

Change-Id: Icbc79ffdad7de05df53b590ca62a7539fd62c6b5
changes/11/74211/1
James E. Blair 8 years ago
parent
commit
ef6f2aa0be
  1. 7
      zuul/merger/server.py

7
zuul/merger/server.py

@ -61,11 +61,14 @@ class MergeServer(object):
port = 4730
self.worker = gear.Worker('Zuul Merger')
self.worker.addServer(server, port)
self.log.debug("Waiting for server")
self.worker.waitForServer()
self.log.debug("Registering")
self.register()
self.log.debug("Starting worker")
self.thread = threading.Thread(target=self.run)
self.thread.daemon = True
self.thread.start()
self.worker.waitForServer()
self.register()
def register(self):
self.worker.registerFunction("merger:merge")

Loading…
Cancel
Save