Orphan-data cleanup no longer causes timeout (#1303)

On older devices with lots of data, the orphan data cleaner can time
out. Here we're trading certainty that the migration completed for
confidence that the boot process doesn't time out.

// FREEBIE
pull/1/head
Michael Kirk 9 years ago committed by GitHub
parent 547cd9797a
commit 6120bd9e8e

@ -38,7 +38,7 @@
</dict> </dict>
</array> </array>
<key>CFBundleVersion</key> <key>CFBundleVersion</key>
<string>2.4.1.0</string> <string>2.4.1.1</string>
<key>ITSAppUsesNonExemptEncryption</key> <key>ITSAppUsesNonExemptEncryption</key>
<false/> <false/>
<key>LOGS_EMAIL</key> <key>LOGS_EMAIL</key>

@ -64,8 +64,14 @@
} }
if ([self isVersion:previousVersion atLeast:@"2.0.0" andLessThan:@"2.4.1"] && [TSAccountManager isRegistered]) { if ([self isVersion:previousVersion atLeast:@"2.0.0" andLessThan:@"2.4.1"] && [TSAccountManager isRegistered]) {
DDLogInfo(@"Running migration: removing orphaned data."); // Cleaning orphaned data can take a while, so let's run it in the background.
[[OWSOrphanedDataCleaner new] removeOrphanedData]; // This means this migration is not resiliant to failures - we'll only run it once
// regardless of its success.
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
DDLogInfo(@"OWSMigration: beginning removing orphaned data.");
[[OWSOrphanedDataCleaner new] removeOrphanedData];
DDLogInfo(@"OWSMigration: completed removing orphaned data.");
});
} }
[Environment.preferences setAndGetCurrentVersion]; [Environment.preferences setAndGetCurrentVersion];

Loading…
Cancel
Save