orphan cleanup shouldn't happen until DB is registered

// FREEBIE
pull/1/head
Michael Kirk 7 years ago
parent 68e755ade9
commit c5244e175e

@ -30,6 +30,7 @@
#import <SignalServiceKit/OWSFailedMessagesJob.h>
#import <SignalServiceKit/OWSMessageManager.h>
#import <SignalServiceKit/OWSMessageSender.h>
#import <SignalServiceKit/OWSOrphanedDataCleaner.h>
#import <SignalServiceKit/OWSReadReceiptManager.h>
#import <SignalServiceKit/TSAccountManager.h>
#import <SignalServiceKit/TSDatabaseView.h>
@ -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];

@ -12,7 +12,6 @@
#import "TSAccountManager.h"
#import "TSNetworkManager.h"
#import <SignalServiceKit/AppVersion.h>
#import <SignalServiceKit/OWSOrphanedDataCleaner.h>
#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];
}

Loading…
Cancel
Save