Skip to content

Commit 779a0d6

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 11da869 commit 779a0d6

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
@@ -259,7 +259,7 @@ async def flush_async(self, timeout: float, callback: Optional[Any] = None) -> N
259259
await self._wait_flush(timeout, callback)
260260
logger.debug("background worker flushed")
261261

262-
def submit(self, callback: Callable[[], None]) -> bool:
262+
def submit(self, callback: Callable[[], Any]) -> bool:
263263
self._ensure_task()
264264

265265
try:

0 commit comments

Comments
 (0)