From 26f49d4b51c5af7eadb5cdf5feb42cb3d1ef5512 Mon Sep 17 00:00:00 2001 From: Maurice Parker Date: Wed, 4 Dec 2019 16:56:09 -0700 Subject: [PATCH] Change to call suspend on main thread when expiration handler called. Issue #1399 --- iOS/AppDelegate.swift | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/iOS/AppDelegate.swift b/iOS/AppDelegate.swift index ac62fb6d0..5d4d694fa 100644 --- a/iOS/AppDelegate.swift +++ b/iOS/AppDelegate.swift @@ -365,7 +365,9 @@ private extension AppDelegate { // set expiration handler task.expirationHandler = { [weak task] in - self.suspendApplication() + DispatchQueue.main.sync { + self.suspendApplication() + } os_log("Accounts refresh processing terminated for running too long.", log: self.log, type: .info) task?.setTaskCompleted(success: false) }