From 63545cf711928e2cbf5554e40370d30846226cee Mon Sep 17 00:00:00 2001 From: Simon Li Date: Wed, 9 Oct 2024 20:33:14 +0100 Subject: [PATCH] await asyncio.ensure_future --- kubespawner/spawner.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/kubespawner/spawner.py b/kubespawner/spawner.py index 306f9be5..00bb2f28 100644 --- a/kubespawner/spawner.py +++ b/kubespawner/spawner.py @@ -2802,7 +2802,7 @@ async def catch_reflector_start(func): if previous_reflector: # we replaced the reflector, stop the old one - asyncio.ensure_future(previous_reflector.stop()) + await asyncio.ensure_future(previous_reflector.stop()) # wait for first load await current_reflector.first_load_future @@ -3254,7 +3254,7 @@ async def _start(self): ref_key, ) self.log.error("Pods: %s", sorted(self.pod_reflector.pods.keys())) - asyncio.ensure_future(self._start_watching_pods(replace=True)) + await asyncio.ensure_future(self._start_watching_pods(replace=True)) raise pod = self.pod_reflector.pods[ref_key] @@ -3379,7 +3379,7 @@ async def stop(self, now=False): self.log.error( "Pod %s did not disappear, restarting pod reflector", ref_key ) - asyncio.ensure_future(self._start_watching_pods(replace=True)) + await asyncio.ensure_future(self._start_watching_pods(replace=True)) raise @default('env_keep')