adds busy check before starting
This commit is contained in:
@@ -323,6 +323,8 @@ def main():
|
||||
parser.add_argument('-n', '--nice', type=lambda x: int(x) if 0 <= int(x) <= 39 else exec('raise ValueError("Nice value must be between 0 and 39")'),
|
||||
default=20,
|
||||
help='Nice value for process priority (default: 20). Valid values are 0 (highest priority) to 39 (lowest priority). Lower values use more system resources.')
|
||||
parser.add_argument('-i', '--ignore-busy', action='store_true',
|
||||
help='Ignore system busy check and run anyway')
|
||||
args = parser.parse_args()
|
||||
|
||||
setup_logging(bool(args.verbose))
|
||||
@@ -331,6 +333,10 @@ def main():
|
||||
destination_dir = args.destination_dir if args.destination_dir else args.source_dir
|
||||
temp_dir = args.temp_dir
|
||||
|
||||
if not args.ignore_busy and is_system_busy():
|
||||
logging.error("System is busy, try again later or use --ignore-busy flag to override")
|
||||
sys.exit(1)
|
||||
|
||||
logging.info(f"Starting video compression from {source_dir} to {destination_dir}")
|
||||
|
||||
global total_files
|
||||
|
||||
Reference in New Issue
Block a user