浏览代码

clear cache fix

marinofaggiana 5 年之前
父节点
当前提交
3dfb6a31b9
共有 1 个文件被更改,包括 19 次插入29 次删除
  1. 19 29
      iOSClient/Settings/CCAdvanced.m

+ 19 - 29
iOSClient/Settings/CCAdvanced.m

@@ -219,39 +219,29 @@
 {
     [appDelegate maintenanceMode:YES];
     
-    [self.hud visibleHudTitle:NSLocalizedString(@"_remove_cache_", nil) mode:MBProgressHUDModeIndeterminate color:nil];
-    
-    dispatch_after(dispatch_time(DISPATCH_TIME_NOW, 0.3 * NSEC_PER_SEC),dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
-        
-        [[NCMainCommon sharedInstance] cancelAllTransfer];
+    [[NCMainCommon sharedInstance] cancelAllTransfer];
 
-        dispatch_after(dispatch_time(DISPATCH_TIME_NOW, 1 * NSEC_PER_SEC), dispatch_get_main_queue(), ^(void) {
+    [[NSURLCache sharedURLCache] setMemoryCapacity:0];
+    [[NSURLCache sharedURLCache] setDiskCapacity:0];
+    [KTVHTTPCache cacheDeleteAllCaches];
+    
+    [[NCManageDatabase sharedInstance] clearDatabaseWithAccount:appDelegate.activeAccount removeUser:false];
+    
+    [CCUtility emptyGroupDirectoryProviderStorage];
+    [CCUtility emptyGroupLibraryDirectory];
+    
+    [CCUtility emptyDocumentsDirectory];
+    [CCUtility emptyTemporaryDirectory];
+    
+    [CCUtility createDirectoryStandard];
 
-            [[NSURLCache sharedURLCache] setMemoryCapacity:0];
-            [[NSURLCache sharedURLCache] setDiskCapacity:0];
-            [KTVHTTPCache cacheDeleteAllCaches];
-            
-            [[NCManageDatabase sharedInstance] clearDatabaseWithAccount:appDelegate.activeAccount removeUser:false];
-            
-            [CCUtility emptyGroupDirectoryProviderStorage];
-            [CCUtility emptyGroupLibraryDirectory];
-            
-            [CCUtility emptyDocumentsDirectory];
-            [CCUtility emptyTemporaryDirectory];
-            
-            [CCUtility createDirectoryStandard];
+    [[NCAutoUpload sharedInstance] alignPhotoLibrary];
+    [appDelegate.filterocId removeAllObjects];
 
-            [[NCAutoUpload sharedInstance] alignPhotoLibrary];
-            [appDelegate.filterocId removeAllObjects];
+    [appDelegate maintenanceMode:NO];
 
-            [appDelegate maintenanceMode:NO];
-        
-            // Close HUD
-            [self.hud hideHud];
-            // Inizialized home
-            [[NSNotificationCenter defaultCenter] postNotificationOnMainThreadName:@"initializeMain" object:nil userInfo:nil];
-        });
-    });
+    // Inizialized home
+    [[NSNotificationCenter defaultCenter] postNotificationOnMainThreadName:@"initializeMain" object:nil userInfo:nil];
 }
 
 - (void)clearCacheRequest:(XLFormRowDescriptor *)sender