Skip to content

Commit 9f226cf

Browse files
committed
Merge branch 'srothh/async-transport' into srothh/async-transport-integration
2 parents e754a85 + 6cb72ad commit 9f226cf

File tree

2 files changed

+2
-6
lines changed

2 files changed

+2
-6
lines changed

sentry_sdk/transport.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
import ssl
88
import time
99
import asyncio
10+
1011
from datetime import datetime, timedelta, timezone
1112
from collections import defaultdict
1213
from urllib.request import getproxies

sentry_sdk/worker.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
import os
44
import threading
55
import asyncio
6-
import inspect
76

87
from time import sleep, time
98
from sentry_sdk._queue import Queue, FullError
@@ -306,11 +305,7 @@ async def _target(self) -> None:
306305

307306
async def _process_callback(self, callback: Callable[[], Any]) -> None:
308307
# Callback is an async coroutine, need to await it
309-
if inspect.iscoroutinefunction(callback):
310-
await callback()
311-
else:
312-
# Callback is a sync function, such as _flush_client_reports()
313-
callback()
308+
await callback()
314309

315310
def _on_task_complete(self, task: asyncio.Task[None]) -> None:
316311
try:

0 commit comments

Comments
 (0)