mirror of
https://github.com/Ranchero-Software/NetNewsWire
synced 2025-08-12 06:26:36 +00:00
Don't try to suspend again if we suspended in the task expiration handler.
This commit is contained in:
@@ -146,6 +146,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterD
|
||||
func prepareAccountsForForeground() {
|
||||
if AccountManager.shared.isSuspended {
|
||||
AccountManager.shared.resumeAll()
|
||||
os_log("Application processing resumed.", log: self.log, type: .info)
|
||||
}
|
||||
|
||||
if let lastRefresh = AppDefaults.lastRefresh {
|
||||
@@ -313,6 +314,7 @@ private extension AppDelegate {
|
||||
}
|
||||
|
||||
AccountManager.shared.suspendDatabaseAll()
|
||||
os_log("Application processing suspended.", log: self.log, type: .info)
|
||||
}
|
||||
|
||||
}
|
||||
@@ -359,9 +361,11 @@ private extension AppDelegate {
|
||||
AccountManager.shared.resumeAll()
|
||||
}
|
||||
AccountManager.shared.refreshAll(errorHandler: ErrorHandler.log) { [unowned self] in
|
||||
self.suspendApplication()
|
||||
os_log("Account refresh operation completed.", log: self.log, type: .info)
|
||||
task?.setTaskCompleted(success: true)
|
||||
if !AccountManager.shared.isSuspended {
|
||||
self.suspendApplication()
|
||||
os_log("Account refresh operation completed.", log: self.log, type: .info)
|
||||
task?.setTaskCompleted(success: true)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user