fix: wait on loguru to flush async logs from services (#7908)
Allow loguru to flush async logs from services
This commit is contained in:
parent
2c6ea9c98f
commit
e0ae3f69c2
1 changed files with 3 additions and 0 deletions
|
|
@ -191,7 +191,10 @@ def get_lifespan(*, fix_migration=False, version=None):
|
|||
sync_flows_from_fs_task.cancel()
|
||||
await asyncio.wait([sync_flows_from_fs_task])
|
||||
await teardown_services()
|
||||
|
||||
await asyncio.sleep(0.1) # let logger flush async logs
|
||||
await logger.complete()
|
||||
|
||||
temp_dir_cleanups = [asyncio.to_thread(temp_dir.cleanup) for temp_dir in temp_dirs]
|
||||
await asyncio.gather(*temp_dir_cleanups)
|
||||
# Final message
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue