Add various retries to the minimuxer calls

This commit is contained in:
Nythepegasus
2023-07-11 01:44:11 -04:00
parent 59e537362e
commit dbdb4b0f32
4 changed files with 57 additions and 46 deletions

View File

@@ -204,17 +204,21 @@ final class InstallAppOperation: ResultOperation<InstalledApp>
}
}
}
do {
try install_ipa(installedApp.bundleIdentifier)
installing = false
} catch {
installing = false
return self.finish(.failure(error))
var attempts = 10
while (attempts != 0){
print("Install ipa attempts left: \(attempts)")
do {
try install_ipa(installedApp.bundleIdentifier)
installing = false
installedApp.refreshedDate = Date()
return self.finish(.success(installedApp))
} catch {
if (attempts == 0){
installing = false
return self.finish(.failure(error))
} else { attempts -= 1 }
}
}
installedApp.refreshedDate = Date()
self.finish(.success(installedApp))
}
}