mirror of
https://github.com/SideStore/SideStore.git
synced 2026-02-15 17:53:31 +01:00
Add various retries to the minimuxer calls
This commit is contained in:
@@ -33,8 +33,7 @@ final class SendAppOperation: ResultOperation<()>
|
||||
|
||||
if let error = self.context.error
|
||||
{
|
||||
self.finish(.failure(error))
|
||||
return
|
||||
return self.finish(.failure(error))
|
||||
}
|
||||
|
||||
guard let resignedApp = self.context.resignedApp else { return self.finish(.failure(OperationError.invalidParameters)) }
|
||||
@@ -46,18 +45,24 @@ final class SendAppOperation: ResultOperation<()>
|
||||
print("AFC App `fileURL`: \(fileURL.absoluteString)")
|
||||
|
||||
if let data = NSData(contentsOf: fileURL) {
|
||||
do {
|
||||
let bytes = Data(data).toRustByteSlice()
|
||||
try yeet_app_afc(app.bundleIdentifier, bytes.forRust())
|
||||
} catch {
|
||||
return self.finish(.failure(error))
|
||||
var attempts = 10
|
||||
while (attempts != 0){
|
||||
print("Send app attempts left: \(attempts)")
|
||||
do {
|
||||
let bytes = Data(data).toRustByteSlice()
|
||||
try yeet_app_afc(app.bundleIdentifier, bytes.forRust())
|
||||
} catch {
|
||||
attempts -= 1
|
||||
if (attempts == 0) {
|
||||
return self.finish(.failure(error))
|
||||
} else { continue }
|
||||
}
|
||||
self.progress.completedUnitCount += 1
|
||||
return self.finish(.success(()))
|
||||
}
|
||||
|
||||
self.progress.completedUnitCount += 1
|
||||
self.finish(.success(()))
|
||||
} else {
|
||||
print("IPA doesn't exist????")
|
||||
self.finish(.failure(ALTServerError(.underlyingError)))
|
||||
return self.finish(.failure(ALTServerError(.underlyingError)))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user