|
@@ -63,6 +63,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterD
|
|
|
var errorITMS90076: Bool = false
|
|
|
|
|
|
private var privacyProtectionWindow: UIWindow?
|
|
|
+ private var autoUploadInprogress: Bool = false
|
|
|
|
|
|
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
|
|
|
|
|
@@ -242,8 +243,11 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterD
|
|
|
}
|
|
|
|
|
|
// Initialize Auto upload
|
|
|
- NCAutoUpload.shared.initAutoUpload(viewController: nil) { items in
|
|
|
- NKCommon.shared.writeLog("Initialize Auto upload with \(items) uploads")
|
|
|
+ if !autoUploadInprogress {
|
|
|
+ NCAutoUpload.shared.initAutoUpload(viewController: nil) { items in
|
|
|
+ NKCommon.shared.writeLog("Initialize Auto upload with \(items) uploads")
|
|
|
+ self.autoUploadInprogress = false
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
// Required unsubscribing / subscribing
|
|
@@ -327,8 +331,12 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterD
|
|
|
NCPushNotification.shared().pushNotification()
|
|
|
|
|
|
// Start Auto Upload
|
|
|
- NCAutoUpload.shared.initAutoUpload(viewController: nil) { items in
|
|
|
- NKCommon.shared.writeLog("Initialize Auto upload with \(items) uploads")
|
|
|
+ if !autoUploadInprogress {
|
|
|
+ autoUploadInprogress = true
|
|
|
+ NCAutoUpload.shared.initAutoUpload(viewController: nil) { items in
|
|
|
+ NKCommon.shared.writeLog("Initialize Auto upload with \(items) uploads")
|
|
|
+ self.autoUploadInprogress = false
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
// Start services
|
|
@@ -392,9 +400,13 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterD
|
|
|
|
|
|
NKCommon.shared.writeLog("Start handler refresh task [Auto upload]")
|
|
|
|
|
|
- NCAutoUpload.shared.initAutoUpload(viewController: nil) { items in
|
|
|
- NKCommon.shared.writeLog("Completition handler refresh task [Auto upload] with \(items) uploads")
|
|
|
- task.setTaskCompleted(success: true)
|
|
|
+ if !autoUploadInprogress {
|
|
|
+ autoUploadInprogress = true
|
|
|
+ NCAutoUpload.shared.initAutoUpload(viewController: nil) { items in
|
|
|
+ NKCommon.shared.writeLog("Completition handler refresh task [Auto upload] with \(items) uploads")
|
|
|
+ self.autoUploadInprogress = false
|
|
|
+ task.setTaskCompleted(success: true)
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -407,10 +419,14 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterD
|
|
|
}
|
|
|
|
|
|
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)
|
|
|
+
|
|
|
+ if !autoUploadInprogress {
|
|
|
+ autoUploadInprogress = true
|
|
|
+ NCAutoUpload.shared.initAutoUpload(viewController: nil) { items in
|
|
|
+ NKCommon.shared.writeLog("Completition handler procesing task [Auto upload] with \(items) uploads")
|
|
|
+ self.autoUploadInprogress = false
|
|
|
+ task.setTaskCompleted(success: true)
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|