From f22239db361817efb837817a1bc65c1381dc189b Mon Sep 17 00:00:00 2001 From: Maurice Parker Date: Tue, 1 Mar 2022 14:43:54 -0600 Subject: [PATCH] Change task completion notification so that it blocks until NNW has completed suspending. Fixes #3200 --- iOS/AppDelegate.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iOS/AppDelegate.swift b/iOS/AppDelegate.swift index f7cbe5b84..aeb74260e 100644 --- a/iOS/AppDelegate.swift +++ b/iOS/AppDelegate.swift @@ -410,11 +410,11 @@ private extension AppDelegate { // set expiration handler task.expirationHandler = { [weak task] in + os_log("Accounts refresh processing terminated for running too long.", log: self.log, type: .info) DispatchQueue.main.sync { self.suspendApplication() + task?.setTaskCompleted(success: false) } - os_log("Accounts refresh processing terminated for running too long.", log: self.log, type: .info) - task?.setTaskCompleted(success: false) } }