Make sure the etcd watch coroutines get called
This commit is contained in:
parent
de9be6e993
commit
313d65a6a4
1 changed files with 4 additions and 3 deletions
|
@ -89,7 +89,7 @@ class EphemeralBuilderManager(BaseManager):
|
||||||
# Map from build UUID to a BuildInfo tuple with information about the build.
|
# Map from build UUID to a BuildInfo tuple with information about the build.
|
||||||
self._build_uuid_to_info = {}
|
self._build_uuid_to_info = {}
|
||||||
|
|
||||||
def _watch_etcd(self, etcd_key, change_callback, start_index=None, recursive=True,
|
def _watch_etcd(self, etcd_key, change_coroutine_callback, start_index=None, recursive=True,
|
||||||
restarter=None):
|
restarter=None):
|
||||||
watch_task_key = (etcd_key, recursive)
|
watch_task_key = (etcd_key, recursive)
|
||||||
def callback_wrapper(changed_key_future):
|
def callback_wrapper(changed_key_future):
|
||||||
|
@ -134,10 +134,11 @@ class EphemeralBuilderManager(BaseManager):
|
||||||
logger.exception('Exception on etcd watch: %s', etcd_key)
|
logger.exception('Exception on etcd watch: %s', etcd_key)
|
||||||
|
|
||||||
if watch_task_key not in self._watch_tasks or self._watch_tasks[watch_task_key].done():
|
if watch_task_key not in self._watch_tasks or self._watch_tasks[watch_task_key].done():
|
||||||
self._watch_etcd(etcd_key, change_callback, start_index=new_index, restarter=restarter)
|
self._watch_etcd(etcd_key, change_coroutine_callback, start_index=new_index,
|
||||||
|
restarter=restarter)
|
||||||
|
|
||||||
if etcd_result:
|
if etcd_result:
|
||||||
change_callback(etcd_result)
|
async(change_coroutine_callback(etcd_result))
|
||||||
|
|
||||||
if not self._shutting_down:
|
if not self._shutting_down:
|
||||||
logger.debug('Scheduling watch of key: %s%s at start index %s', etcd_key,
|
logger.debug('Scheduling watch of key: %s%s at start index %s', etcd_key,
|
||||||
|
|
Reference in a new issue