Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions compass/utilities/logs.py
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,9 @@ class LocationFileLog:
)
"""Formatter used for text logs"""

ASYNC_EXIT_SLEEP_SECONDS = 3
"""Number of seconds to wait between async log flush checks"""

def __init__(
self, listener, log_dir, location, level="INFO", max_teardown_time=30
):
Expand Down Expand Up @@ -361,8 +364,8 @@ async def __aexit__(self, exc_type, exc, tb):
not LOGGING_QUEUE.empty()
and (time.monotonic() - start_time) < self.max_teardown_time
):
await asyncio.sleep(3)
await asyncio.sleep(3) # Final recording
await asyncio.sleep(self.ASYNC_EXIT_SLEEP_SECONDS)
await asyncio.sleep(self.ASYNC_EXIT_SLEEP_SECONDS) # Final recording
self.__exit__(exc_type, exc, tb)


Expand Down
Loading
Loading