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>
</array>
<key>CFBundleVersion</key>
<string>2.4.1.0</string>
<string>2.4.1.1</string>
<key>ITSAppUsesNonExemptEncryption</key>
<false/>
<key>LOGS_EMAIL</key>

@ -64,8 +64,14 @@
}
if ([self isVersion:previousVersion atLeast:@"2.0.0" andLessThan:@"2.4.1"] && [TSAccountManager isRegistered]) {
DDLogInfo(@"Running migration: removing orphaned data.");
[[OWSOrphanedDataCleaner new] removeOrphanedData];
// Cleaning orphaned data can take a while, so let's run it in the background.
// 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];

Loading…
Cancel
Save