Skip to content

Commit 8c3bd51

Browse files
committed
clear outstanding health check on failure
should always be cleared when it completes, whether it was a success or failure
1 parent adf2bb4 commit 8c3bd51

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)