Skip to content

Commit

Permalink
Merge branch 'feature/flush-logs' into testing
Browse files Browse the repository at this point in the history
  • Loading branch information
WillB97 committed Jul 10, 2024
2 parents f63ac3e + 2cdb35d commit e05987f
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions runusb/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,16 @@ def cleanup(self) -> None:
except subprocess.TimeoutExpired:
# The process did not exit after 5 seconds, so kill it.
self._send_signal(signal.SIGKILL)

# Ensure logs have finished writing
self.log_thread.join()

# Explicitly close handler before removing it
self.handler.close()

# Sync filesystems before reporting status
os.sync()

self._set_leds()

def close(self) -> None:
Expand Down

0 comments on commit e05987f

Please sign in to comment.