|
15 | 15 | #import <BackgroundTasks/BGTaskRequest.h>
|
16 | 16 | #import <BackgroundTasks/BGTask.h>
|
17 | 17 |
|
| 18 | +#import <SDWebImage/SDImageCache.h> |
| 19 | + |
18 | 20 | #import "NCAudioController.h"
|
19 | 21 | #import "NCAppBranding.h"
|
20 | 22 | #import "NCDatabaseManager.h"
|
@@ -67,15 +69,19 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(
|
67 | 69 | NSLog(@"Configure App Settings");
|
68 | 70 | [NCSettingsController sharedInstance];
|
69 | 71 |
|
70 |
| - // Perform logfile cleanup only once in app lifecycle |
71 |
| - dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_BACKGROUND, 0), ^{ |
72 |
| - [NCUtils removeOldLogfiles]; |
| 72 | + // Perform cleanup only once in app lifecycle |
| 73 | + dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(10 * NSEC_PER_SEC)), dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_BACKGROUND, 0), ^(void){ |
| 74 | + @autoreleasepool { |
| 75 | + [NCUtils removeOldLogfiles]; |
| 76 | + [[SDImageCache sharedImageCache].diskCache removeExpiredData]; |
| 77 | + [[NCSettingsController sharedInstance] createAccountsFile]; |
| 78 | + } |
73 | 79 | });
|
74 | 80 |
|
75 | 81 | UIDevice *currentDevice = [UIDevice currentDevice];
|
76 | 82 | [NCUtils log:[NSString stringWithFormat:@"Starting %@, version %@, %@ %@, model %@", NSBundle.mainBundle.bundleIdentifier, [NCAppBranding getAppVersionString], currentDevice.systemName, currentDevice.systemVersion, currentDevice.model]];
|
77 | 83 |
|
78 |
| - //Init rooms manager to start receiving NSNotificationCenter notifications |
| 84 | + // Init rooms manager to start receiving NSNotificationCenter notifications |
79 | 85 | [NCRoomsManager sharedInstance];
|
80 | 86 |
|
81 | 87 | [self registerBackgroundFetchTask];
|
|
0 commit comments