Skip to content

Commit 70f228e

Browse files
committed
ref(transport): Adapt transport for synchronous flush interface
GH-4582
1 parent ee0b440 commit 70f228e

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

sentry_sdk/transport.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -691,16 +691,17 @@ def capture_envelope(self: Self, envelope: Envelope) -> None:
691691
for item in envelope.items:
692692
self.record_lost_event("no_async_context", item=item)
693693

694-
async def flush_async(
694+
def flush( # type: ignore[override]
695695
self: Self,
696696
timeout: float,
697697
callback: Optional[Callable[[int, float], None]] = None,
698-
) -> None:
698+
) -> Optional[asyncio.Task[None]]:
699699
logger.debug("Flushing HTTP transport")
700700

701701
if timeout > 0:
702702
self._worker.submit(lambda: self._flush_client_reports(force=True))
703-
await self._worker.flush_async(timeout, callback) # type: ignore
703+
return self._worker.flush(timeout, callback)
704+
return None
704705

705706
def _get_pool_options(self: Self) -> Dict[str, Any]:
706707
options: Dict[str, Any] = {

0 commit comments

Comments
 (0)