|
@@ -387,28 +387,24 @@
|
|
|
}
|
|
|
|
|
|
#pragma --------------------------------------------------------------------------------------------
|
|
|
-#pragma mark ===== Verify Process =====
|
|
|
+#pragma mark ===== Verify Process [ONLY FOREGROUND] =====
|
|
|
#pragma --------------------------------------------------------------------------------------------
|
|
|
|
|
|
- (void)verifyProcess
|
|
|
{
|
|
|
- // Not in background
|
|
|
-
|
|
|
if ([[UIApplication sharedApplication] applicationState] != UIApplicationStateBackground) {
|
|
|
|
|
|
// Verify Synchronized Folder
|
|
|
NSMutableArray *metadatasNet = [self verifyExistsInQueuesUploadSelector:selectorDownloadSynchronized];
|
|
|
-
|
|
|
+ NSLog(@"5 sec. %lu", (unsigned long)[metadatasNet count]);
|
|
|
+
|
|
|
if ([CCCoreData countTableAutomaticUploadForAccount:self.activeAccount selector:selectorUploadAutomatic] > 0)
|
|
|
- if ([[self verifyExistsInQueuesUploadSelector:selectorUploadAutomatic] count] == 0)
|
|
|
- [app loadTableAutomaticUploadForSelector:selectorUploadAutomatic];
|
|
|
+ [app loadTableAutomaticUploadForSelector:selectorUploadAutomatic];
|
|
|
|
|
|
if ([CCCoreData countTableAutomaticUploadForAccount:self.activeAccount selector:selectorUploadAutomaticAll] > 0)
|
|
|
- if ([[self verifyExistsInQueuesUploadSelector:selectorUploadAutomaticAll] count] == 0)
|
|
|
- [app loadTableAutomaticUploadForSelector:selectorUploadAutomaticAll];
|
|
|
+ [app loadTableAutomaticUploadForSelector:selectorUploadAutomaticAll];
|
|
|
|
|
|
}
|
|
|
- //NSLog(@"5 sec. %lu", (unsigned long)[metadatasNet count]);
|
|
|
}
|
|
|
|
|
|
#pragma --------------------------------------------------------------------------------------------
|
|
@@ -1100,8 +1096,11 @@
|
|
|
|
|
|
- (void)loadTableAutomaticUploadForSelector:(NSString *)selector
|
|
|
{
|
|
|
+ // Only one
|
|
|
+ if ([[self verifyExistsInQueuesUploadSelector:selector] count] > 1)
|
|
|
+ return;
|
|
|
+
|
|
|
// Verify num error if selectorUploadAutomaticAll
|
|
|
-
|
|
|
if ([selector isEqualToString:selectorUploadAutomaticAll]) {
|
|
|
|
|
|
NSUInteger count = [TableMetadata MR_countOfEntitiesWithPredicate:[NSPredicate predicateWithFormat:@"(account == %@) AND (sessionSelector == %@) AND ((sessionTaskIdentifier == %i) OR (sessionTaskIdentifierPlist == %i))", app.activeAccount, selectorUploadAutomaticAll,taskIdentifierError, taskIdentifierError]];
|
|
@@ -1121,7 +1120,6 @@
|
|
|
}
|
|
|
|
|
|
// Add Network queue
|
|
|
-
|
|
|
CCMetadataNet *metadataNet = [CCCoreData getTableAutomaticUploadForAccount:self.activeAccount selector:selector context:nil];
|
|
|
|
|
|
if (metadataNet) {
|