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
  • Loading branch information
frascuchon committed May 25, 2022
1 parent 00172c4 commit c610273
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/rubrix/client/api.py
Expand Up @@ -277,7 +277,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 c610273

Please sign in to comment.