Skip to content

Commit 82d93fd

Browse files
Allow _check_to_close_session to exit normally if we are done
1 parent e44fb20 commit 82d93fd

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

src/replit_river/v2/session.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -975,17 +975,14 @@ async def _check_to_close_session(
975975
await asyncio.sleep(close_session_check_interval_ms / 1000)
976976
if get_state() in TerminalStates:
977977
# already closing
978-
return
978+
break
979979
# calculate the value now before comparing it so that there are no
980980
# await points between the check and the comparison to avoid a TOCTOU
981981
# race.
982982
current_time = await get_current_time()
983983
close_session_after_time_secs = get_close_session_after_time_secs()
984984
if not close_session_after_time_secs:
985985
continue
986-
logging.debug(
987-
"_check_to_close_session: Preparing to close session if not interrupted"
988-
)
989986
if current_time > close_session_after_time_secs:
990987
logger.info("Grace period ended for %s, closing session", transport_id)
991988
await do_close()

0 commit comments

Comments
 (0)