Browse Source

Merge pull request #1208 from deltachat/call-maybeNetwork-on-time

Revert "just never call maybeNetwork() from ui thread"
bjoern 4 years ago
parent
commit
8ba384df89
1 changed files with 1 additions and 7 deletions
  1. 1 7
      deltachat-ios/AppDelegate.swift

+ 1 - 7
deltachat-ios/AppDelegate.swift

@@ -370,13 +370,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterD
 
         // we're in background, run IO for a little time
         dcContext.maybeStartIo()
-
-        // maybeNetwork() shall not be called in ui thread;
-        // even if we're in backround now, app may be starting just now and maybeNetwork() will block in that case
-        // (series of performFetchWithCompletionHandler/applicationWillEnterForeground are not rare)
-        DispatchQueue.global(qos: .background).async { [weak self] in
-            self?.dcContext.maybeNetwork()
-        }
+        dcContext.maybeNetwork()
 
         DispatchQueue.main.asyncAfter(deadline: .now() + 10) { [weak self] in
             logger.info("⬅️ finishing fetch")