Preheat UI DB views.
This commit is contained in:
parent
e453d19c18
commit
5f637f24e9
|
@ -1213,6 +1213,22 @@ static NSTimeInterval launchStartedAt;
|
|||
[self.messageManager startObserving];
|
||||
|
||||
[self.udManager setup];
|
||||
|
||||
[self preheatDatabaseViews];
|
||||
}
|
||||
|
||||
- (void)preheatDatabaseViews
|
||||
{
|
||||
[self.primaryStorage.uiDatabaseConnection asyncReadWithBlock:^(YapDatabaseReadTransaction *transaction) {
|
||||
for (NSString *viewName in @[
|
||||
TSThreadDatabaseViewExtensionName,
|
||||
TSMessageDatabaseViewExtensionName,
|
||||
TSThreadOutgoingMessageDatabaseViewExtensionName,
|
||||
]) {
|
||||
YapDatabaseViewTransaction *databaseView = [transaction ext:viewName];
|
||||
OWSAssertDebug([databaseView isKindOfClass:[YapDatabaseViewTransaction class]]);
|
||||
}
|
||||
}];
|
||||
}
|
||||
|
||||
- (void)registrationStateDidChange
|
||||
|
|
|
@ -14,6 +14,7 @@ extern NSString *const TSThreadDatabaseViewExtensionName;
|
|||
|
||||
extern NSString *const TSMessageDatabaseViewExtensionName;
|
||||
extern NSString *const TSUnreadDatabaseViewExtensionName;
|
||||
extern NSString *const TSThreadOutgoingMessageDatabaseViewExtensionName;
|
||||
|
||||
extern NSString *const TSSecondaryDevicesDatabaseViewExtensionName;
|
||||
|
||||
|
|
Loading…
Reference in New Issue