From abb204e6e901fd56555c3281a295533b90229109 Mon Sep 17 00:00:00 2001 From: Ovear Date: Thu, 23 Oct 2025 19:45:22 +0800 Subject: [PATCH] fix: graceful exit when disk usage threshold is reached (#1239) --- main.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/main.py b/main.py index 6ed2069..1b2e74c 100644 --- a/main.py +++ b/main.py @@ -1932,10 +1932,10 @@ while True: check_path = video_save_path or default_path if utils.check_disk_capacity(check_path, show=first_run) < disk_space_limit: exit_recording = True - if not recording: - logger.warning(f"Disk space remaining is below {disk_space_limit} GB. " - f"Exiting program due to the disk space limit being reached.") - sys.exit(-1) + if exit_recording and not recording: + logger.warning(f"Disk space remaining is below {disk_space_limit} GB. " + f"Exiting program due to the disk space limit being reached.") + sys.exit(-1) def contains_url(string: str) -> bool: