Skip to content

Commit ed392e9

Browse files
committed
ref(client): Move timeout check in client to properly cover async
GH-4601
1 parent f4ac157 commit ed392e9

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

sentry_sdk/client.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -939,6 +939,7 @@ def close( # type: ignore[override]
939939
async def _flush_and_close(
940940
timeout: Optional[float], callback: Optional[Callable[[int, float], None]]
941941
) -> None:
942+
942943
await self._flush_async(timeout=timeout, callback=callback)
943944
self._close_components()
944945

@@ -997,6 +998,9 @@ async def _flush_async(
997998
self, timeout: Optional[float], callback: Optional[Callable[[int, float], None]]
998999
) -> None:
9991000

1001+
if timeout is None:
1002+
timeout = self.options["shutdown_timeout"]
1003+
10001004
self.session_flusher.flush()
10011005
if self.log_batcher is not None:
10021006
self.log_batcher.flush()

0 commit comments

Comments
 (0)