added case if clean_process or add_process return -1

This commit is contained in:
raphael60650 2021-06-19 09:20:06 +02:00
parent 58192ffe75
commit 1e8bb0b13c

View file

@ -114,8 +114,14 @@ def patch_track(self, tracks, total_track="?"):
track_file = get_trackname(track=track) track_file = get_trackname(track=track)
while True: while True:
if len(process_list) < max_process: if len(process_list) < max_process:
if add_process(track_file) == 0: break returncode = add_process(track_file)
else: clean_process() if returncode == 0: break
while clean_process() != 1: pass # End the process if all process ended elif returncode == -1: return -1 # if error occur, stop function
elif clean_process() == -1: return -1
while True:
returncode = clean_process()
if returncode == 1: break # End the process if all process ended
elif returncode == -1: return
return 0 return 0