Don't start app version migrations until storage is ready.

pull/1/head
Matthew Chen 7 years ago
parent 2265ae08aa
commit eb3569d8f8

@ -52,14 +52,16 @@ NS_ASSUME_NONNULL_BEGIN
[NSKeyedUnarchiver setClass:[OWSDatabaseMigration class] forClassName:[OWSDatabaseMigration collection]]; [NSKeyedUnarchiver setClass:[OWSDatabaseMigration class] forClassName:[OWSDatabaseMigration collection]];
[OWSStorage setupStorageWithMigrationBlock:^() { [OWSStorage setupStorageWithMigrationBlock:^() {
// Don't start database migrations until storage is ready. dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
[VersionMigrations performUpdateCheckWithCompletion:^() { // Don't start database migrations until storage is ready.
OWSAssertIsOnMainThread(); [VersionMigrations performUpdateCheckWithCompletion:^() {
OWSAssertIsOnMainThread();
migrationCompletion(); migrationCompletion();
backgroundTask = nil; backgroundTask = nil;
}]; }];
});
}]; }];
[[Environment current].contactsManager startObserving]; [[Environment current].contactsManager startObserving];
}); });

Loading…
Cancel
Save