Skip to content

Commit e98397f

Browse files
committed
ref(worker): Amend return type of submit and flush to accomodate for coroutines
Coroutines do not return None, therefore it is necessary to consider this in the callback parameter of the worker. Previously, only callbacks with return Type None were accepted. GH-4581
1 parent 577c5d7 commit e98397f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

sentry_sdk/worker.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ async def flush_async(self, timeout: float, callback: Optional[Any] = None) -> N
243243
await self._wait_flush(timeout, callback)
244244
logger.debug("background worker flushed")
245245

246-
def submit(self, callback: Callable[[], None]) -> bool:
246+
def submit(self, callback: Callable[[], Any]) -> bool:
247247
self._ensure_task()
248248

249249
try:

0 commit comments

Comments
 (0)