Add retries in the various minimuxer functions

This commit is contained in:
Nythepegasus
2022-12-18 10:24:11 -05:00
committed by Joe Mattiello
parent 7162a029bb
commit fc6d92d1fc
2 changed files with 35 additions and 5 deletions

View File

@@ -146,7 +146,13 @@ class LaunchViewController: RSTLaunchViewController, UIDocumentPickerDelegate
func start_minimuxer_threads(_ pairing_file: String) {
set_usbmuxd_socket()
let res = start_minimuxer(pairing_file: pairing_file)
var res = start_minimuxer(pairing_file: pairing_file)
var attempts = 10
while (attempts != 0 && res != 0) {
print("start_minimuxer `res` != 0, retry #\(attempts)")
res = start_minimuxer(pairing_file: pairing_file)
attempts -= 1
}
if res != 0 {
displayError("minimuxer failed to start. Incorrect arguments were passed.")
}