fix: graceful exit when disk usage threshold is reached (#1239)

This commit is contained in:
Ovear 2025-10-23 19:45:22 +08:00 committed by GitHub
parent 271a53621d
commit abb204e6e9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1932,7 +1932,7 @@ 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:
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)