Skip to content

Commit 02b779e

Browse files
authored
Merge pull request #1220 from minrk/await-outstanding
clear outstanding health check on failure
2 parents adf2bb4 + 8c3bd51 commit 02b779e

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

binderhub/health.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -74,10 +74,12 @@ async def wrapper(*args, **kwargs):
7474
now = time.monotonic()
7575
if now > last_time + interval:
7676
outstanding = asyncio.ensure_future(f(*args, **kwargs))
77-
last_result = await outstanding
78-
# complete, clear outstanding future and note the time
79-
outstanding = None
80-
last_time = time.monotonic()
77+
try:
78+
last_result = await outstanding
79+
finally:
80+
# complete, clear outstanding future and note the time
81+
outstanding = None
82+
last_time = time.monotonic()
8183
return last_result
8284

8385
return wrapper

0 commit comments

Comments
 (0)