Преглед изворни кода

fix

Signed-off-by: Marino Faggiana <marino@marinofaggiana.com>
Marino Faggiana пре 2 година
родитељ
комит
906161f35d
1 измењених фајлова са 5 додато и 11 уклоњено
  1. 5 11
      iOSClient/AppDelegate.swift

+ 5 - 11
iOSClient/AppDelegate.swift

@@ -366,7 +366,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterD
 
         let request = BGProcessingTaskRequest(identifier: NCGlobal.shared.processingTask)
         request.earliestBeginDate = Date(timeIntervalSinceNow: 5 * 60) // Refresh after 5 minutes.
-        request.requiresNetworkConnectivity = true
+        request.requiresNetworkConnectivity = false
         request.requiresExternalPower = false
         do {
             try BGTaskScheduler.shared.submit(request)
@@ -404,16 +404,10 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterD
             return
         }
 
-        NKCommon.shared.writeLog("Start handler processing task [Synchronize Favorite & Offline]")
-
-        NCNetworking.shared.listingFavoritescompletion(selector: NCGlobal.shared.selectorReadFile) { _, _, error in
-            NKCommon.shared.writeLog("Completition listing favorite with error: \(error.errorCode)")
-        }
-
-        NCService.shared.synchronizeOffline(account: account)
-
-        DispatchQueue.main.asyncAfter(deadline: .now() + 25) {
-            NKCommon.shared.writeLog("Completition handler processing task [Synchronize Favorite & Offline]")
+        NKCommon.shared.writeLog("Start handler processing task [Auto upload]")
+        
+        NCAutoUpload.shared.initAutoUpload(viewController: nil) { items in
+            NKCommon.shared.writeLog("Completition handler procesing task [Auto upload] with \(items) uploads")
             task.setTaskCompleted(success: true)
         }
     }