Skip to content

Commit

Permalink
Merge pull request #860 from manics/await-ensure-future
Browse files Browse the repository at this point in the history
await asyncio.ensure_future
  • Loading branch information
consideRatio authored Oct 11, 2024
2 parents 7ba57a8 + 63545cf commit 05e05b4
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions kubespawner/spawner.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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]
Expand Down Expand Up @@ -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')
Expand Down

0 comments on commit 05e05b4

Please sign in to comment.