mirror of
https://github.com/SideStore/SideStore.git
synced 2026-02-18 19:23:43 +01:00
Finally fix retries for minimuxer calls
This commit is contained in:
committed by
nythepegasus
parent
090456bba1
commit
cc5c280882
@@ -31,10 +31,7 @@ final class DeactivateAppOperation: ResultOperation<InstalledApp>
|
||||
{
|
||||
super.main()
|
||||
|
||||
if let error = self.context.error
|
||||
{
|
||||
return self.finish(.failure(error))
|
||||
}
|
||||
if let error = self.context.error { return self.finish(.failure(error)) }
|
||||
|
||||
DatabaseManager.shared.persistentContainer.performBackgroundTask { (context) in
|
||||
let installedApp = context.object(with: self.app.objectID) as! InstalledApp
|
||||
@@ -42,13 +39,21 @@ final class DeactivateAppOperation: ResultOperation<InstalledApp>
|
||||
let allIdentifiers = [installedApp.resignedBundleIdentifier] + appExtensionProfiles
|
||||
|
||||
for profile in allIdentifiers {
|
||||
do {
|
||||
try remove_provisioning_profile(profile)
|
||||
self.progress.completedUnitCount += 1
|
||||
installedApp.isActive = false
|
||||
return self.finish(.success(installedApp))
|
||||
} catch {
|
||||
return self.finish(.failure(error))
|
||||
var attempts = 5
|
||||
while (attempts > 0){
|
||||
print("Remove Provisioning profile attempts left: \(attempts)")
|
||||
do {
|
||||
try remove_provisioning_profile(profile)
|
||||
self.progress.completedUnitCount += 1
|
||||
installedApp.isActive = false
|
||||
self.finish(.success(installedApp))
|
||||
break
|
||||
} catch {
|
||||
attempts -= 1
|
||||
if (attempts <= 0){
|
||||
self.finish(.failure(error))
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user