From c5244e175e727633d81bce8c27cba9ca449faca3 Mon Sep 17 00:00:00 2001 From: Michael Kirk Date: Sat, 21 Oct 2017 18:16:31 -0700 Subject: [PATCH] orphan cleanup shouldn't happen until DB is registered // FREEBIE --- Signal/src/AppDelegate.m | 12 ++++++++++++ Signal/src/environment/VersionMigrations.m | 12 ------------ 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/Signal/src/AppDelegate.m b/Signal/src/AppDelegate.m index 9a1e9459b..bc8348e08 100644 --- a/Signal/src/AppDelegate.m +++ b/Signal/src/AppDelegate.m @@ -30,6 +30,7 @@ #import #import #import +#import #import #import #import @@ -855,6 +856,17 @@ static NSString *const kURLHostVerifyPrefix = @"verify"; self.isEnvironmentSetup = YES; +#ifdef DEBUG + // A bug in orphan cleanup could be disastrous so let's only + // run it in DEBUG builds for a few releases. + // + // TODO: Release to production once we have analytics. + // TODO: Orphan cleanup is somewhat expensive - not least in doing a bunch + // of disk access. We might want to only run it "once per version" + // or something like that in production. + [OWSOrphanedDataCleaner auditAndCleanupAsync:nil]; +#endif + [OWSProfileManager.sharedManager fetchLocalUsersProfile]; [[OWSReadReceiptManager sharedManager] prepareCachedValues]; [[Environment getCurrent].contactsManager loadLastKnownContactRecipientIds]; diff --git a/Signal/src/environment/VersionMigrations.m b/Signal/src/environment/VersionMigrations.m index fceae5a70..880f56d59 100644 --- a/Signal/src/environment/VersionMigrations.m +++ b/Signal/src/environment/VersionMigrations.m @@ -12,7 +12,6 @@ #import "TSAccountManager.h" #import "TSNetworkManager.h" #import -#import #define NEEDS_TO_REGISTER_PUSH_KEY @"Register For Push" #define NEEDS_TO_REGISTER_ATTRIBUTES @"Register Attributes" @@ -79,17 +78,6 @@ [self clearBloomFilterCache]; } -#ifdef DEBUG - // A bug in orphan cleanup could be disastrous so let's only - // run it in DEBUG builds for a few releases. - // - // TODO: Release to production once we have analytics. - // TODO: Orphan cleanup is somewhat expensive - not least in doing a bunch - // of disk access. We might want to only run it "once per version" - // or something like that in production. - [OWSOrphanedDataCleaner auditAndCleanupAsync:nil]; -#endif - [[[OWSDatabaseMigrationRunner alloc] initWithStorageManager:[TSStorageManager sharedManager]] runAllOutstanding]; }