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]; }