Converge appLaunchTime.

pull/1/head
Matthew Chen 7 years ago
parent b3c62d91be
commit 1868c58037

@ -590,7 +590,7 @@ typedef void (^OrphanDataBlock)(OWSOrphanData *);
// We need to avoid cleaning up new attachments and files that are still in the process of
// being created/written, so we don't clean up anything recent.
const NSTimeInterval kMinimumOrphanAgeSeconds = CurrentAppContext().isRunningTests ? 0.f : 15 * kMinuteInterval;
NSDate *appLaunchTime = AppVersion.sharedInstance.appLaunchTime;
NSDate *appLaunchTime = CurrentAppContext().appLaunchTime;
NSTimeInterval thresholdTimestamp = appLaunchTime.timeIntervalSince1970 - kMinimumOrphanAgeSeconds;
NSDate *thresholdDate = [NSDate dateWithTimeIntervalSince1970:thresholdTimestamp];
[databaseConnection readWriteWithBlock:^(YapDatabaseReadWriteTransaction *transaction) {

@ -14,8 +14,6 @@
@property (atomic, readonly) NSString *lastCompletedLaunchMainAppVersion;
@property (atomic, readonly) NSString *lastCompletedLaunchSAEAppVersion;
@property (atomic, readonly) NSDate *appLaunchTime;
- (instancetype)init NS_UNAVAILABLE;
+ (instancetype)sharedInstance;

@ -43,8 +43,6 @@ NSString *const kNSUserDefaults_LastCompletedLaunchAppVersion_SAE
- (void)configure {
OWSAssertIsOnMainThread();
_appLaunchTime = [NSDate new];
self.currentAppVersion = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleShortVersionString"];
// The version of the app when it was first launched.

Loading…
Cancel
Save