Skip to content

Commit e184579

Browse files
committed
use sync context for the complete reporting
1 parent c5426d9 commit e184579

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

ml_logger/VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.8.31
1+
0.8.32

ml_logger/ml_logger/__init__.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -186,10 +186,12 @@ def thunk(*args, **kwargs):
186186

187187
results = fn(*(args or ARGS), **_KWARGS)
188188

189-
logger.log_line("========== execution is complete ==========")
190-
logger.job_completed()
191-
logger.flush()
189+
with logger.SyncContext(): # Make sure uploaded finished before termination.
190+
logger.log_line("========== execution is complete ==========")
191+
logger.job_completed()
192+
logger.flush()
192193
time.sleep(3)
194+
193195
except Exception as e:
194196
tb = traceback.format_exc()
195197
with logger.SyncContext(): # Make sure uploaded finished before termination.

0 commit comments

Comments
 (0)