Skip to content

Commit

Permalink
fix(#1517): stop background task when something happens to main thread (
Browse files Browse the repository at this point in the history
#1519)

Closes #1517

(cherry picked from commit c610273)
  • Loading branch information
frascuchon committed May 30, 2022
1 parent 0a02c70 commit 0304f40
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/rubrix/client/api.py
Expand Up @@ -272,7 +272,11 @@ def log(
)
if background:
return future
return future.result()

try:
return future.result()
finally:
future.cancel()

async def log_async(
self,
Expand Down

0 comments on commit 0304f40

Please sign in to comment.