Revert the retries here as these seem buggier

This commit is contained in:
Nythepegasus
2023-07-24 09:22:34 -04:00
parent e17776f651
commit 77dc695ba1
2 changed files with 14 additions and 27 deletions

View File

@@ -33,8 +33,7 @@ final class DeactivateAppOperation: ResultOperation<InstalledApp>
if let error = self.context.error
{
self.finish(.failure(error))
return
return self.finish(.failure(error))
}
DatabaseManager.shared.persistentContainer.performBackgroundTask { (context) in
@@ -43,19 +42,13 @@ final class DeactivateAppOperation: ResultOperation<InstalledApp>
let allIdentifiers = [installedApp.resignedBundleIdentifier] + appExtensionProfiles
for profile in allIdentifiers {
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
return self.finish(.success(installedApp))
} catch {
if (attempts == 0){
return self.finish(.failure(error))
} else { attempts -= 1 }
}
do {
try remove_provisioning_profile(profile)
self.progress.completedUnitCount += 1
installedApp.isActive = false
return self.finish(.success(installedApp))
} catch {
return self.finish(.failure(error))
}
}
}

View File

@@ -42,19 +42,13 @@ final class RefreshAppOperation: ResultOperation<InstalledApp>
DatabaseManager.shared.persistentContainer.performBackgroundTask { (context) in
print("Sending refresh app request...")
for p in profiles {
var attempts = 5
while (attempts != 0){
print("Install provisioning profile attempts left: \(attempts)")
do {
let bytes = p.value.data.toRustByteSlice()
try install_provisioning_profile(bytes.forRust())
} catch {
if (attempts == 0) {
return self.finish(.failure(error))
} else { attempts -= 1 }
}
do {
let bytes = p.value.data.toRustByteSlice()
try install_provisioning_profile(bytes.forRust())
} catch {
return self.finish(.failure(error))
}
self.progress.completedUnitCount += 1