Skip to content

Commit 25602dd

Browse files
committed
fix: Close the owned session even if the SSE close fails
1 parent 58a4f3e commit 25602dd

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

ldclient/impl/datasource/async_streaming.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,10 @@ async def _run(self):
118118
break
119119
finally:
120120
if self._sse:
121-
await self._sse.close()
121+
try:
122+
await self._sse.close()
123+
except Exception as e:
124+
log.warning("Error closing stream connection during shutdown: %s" % e)
122125
await self._close_owned_session()
123126

124127
async def _close_owned_session(self):

0 commit comments

Comments
 (0)