fixes global busy ignore
This commit is contained in:
@@ -16,6 +16,8 @@ video_extensions: list[str] = ["mp4", "mkv", "avi", "wmv", "mov", "m4v", "ts", "
|
||||
|
||||
total_files: int = 0
|
||||
|
||||
ignore_busy = False
|
||||
|
||||
def is_system_busy() -> bool:
|
||||
"""Returns true if the cpu is doing something else. maybe."""
|
||||
# First call all processes, so we can recheck them later.
|
||||
@@ -160,7 +162,7 @@ def run_progress(process, duration, file_index=0) -> bool:
|
||||
if line and line.startswith('out_time_ms='):
|
||||
try:
|
||||
if time.time() - last_update > UPDATE_INTERVAL:
|
||||
if is_system_busy():
|
||||
if not ignore_busy and is_system_busy():
|
||||
if pbar:
|
||||
pbar.close()
|
||||
return False
|
||||
@@ -347,6 +349,9 @@ def main():
|
||||
logging.error("System is busy, try again later or use --ignore-busy flag to override")
|
||||
sys.exit(1)
|
||||
|
||||
global ignore_busy
|
||||
ignore_busy = bool(args.ignore_busy)
|
||||
|
||||
logging.info(f"Starting video compression from {source_dir} to {destination_dir}")
|
||||
|
||||
global total_files
|
||||
|
||||
Reference in New Issue
Block a user