Skip to content

Commit dfc32d2

Browse files
committed
bugbot
1 parent df9b493 commit dfc32d2

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

template/server/messaging.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -394,12 +394,10 @@ async def execute(
394394
# Stream the results.
395395
# If the client disconnects (Starlette cancels the task), we
396396
# interrupt the kernel so the next execution isn't blocked (#213).
397-
client_disconnected = False
398397
try:
399398
async for item in self._wait_for_result(message_id):
400399
yield item
401400
except (asyncio.CancelledError, GeneratorExit):
402-
client_disconnected = True
403401
logger.warning(
404402
f"Client disconnected during execution ({message_id}), interrupting kernel"
405403
)
@@ -415,7 +413,7 @@ async def execute(
415413
del self._executions[message_id]
416414

417415
# Clean up env vars in a separate request after the main code has run
418-
if env_vars and not client_disconnected:
416+
if env_vars:
419417
self._cleanup_task = asyncio.create_task(
420418
self._cleanup_env_vars(env_vars)
421419
)

0 commit comments

Comments
 (0)