Make sure the etcd watch coroutines get called

This commit is contained in:
Joseph Schorr 2016-08-16 13:02:27 -04:00
parent de9be6e993
commit 313d65a6a4

View file

@ -89,7 +89,7 @@ class EphemeralBuilderManager(BaseManager):
# Map from build UUID to a BuildInfo tuple with information about the build.
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):
watch_task_key = (etcd_key, recursive)
def callback_wrapper(changed_key_future):
@ -134,10 +134,11 @@ class EphemeralBuilderManager(BaseManager):
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():
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:
change_callback(etcd_result)
async(change_coroutine_callback(etcd_result))
if not self._shutting_down:
logger.debug('Scheduling watch of key: %s%s at start index %s', etcd_key,