mirror of
https://github.com/oxen-io/session-ios.git
synced 2023-12-13 21:30:14 +01:00
Use dedicated db connection in orphan data cleaner.
This commit is contained in:
parent
ada1f1ae12
commit
95bc7a23f7
|
@ -457,7 +457,7 @@ typedef void (^OrphanDataBlock)(OWSOrphanData *);
|
|||
OWSAssertIsOnMainThread();
|
||||
|
||||
OWSPrimaryStorage *primaryStorage = [OWSPrimaryStorage sharedManager];
|
||||
YapDatabaseConnection *databaseConnection = primaryStorage.dbReadWriteConnection;
|
||||
YapDatabaseConnection *databaseConnection = [primaryStorage newDatabaseConnection];
|
||||
|
||||
if (![self shouldAuditOnLaunch:databaseConnection]) {
|
||||
return;
|
||||
|
@ -479,7 +479,7 @@ typedef void (^OrphanDataBlock)(OWSOrphanData *);
|
|||
+ (void)auditAndCleanup:(BOOL)shouldRemoveOrphans completion:(dispatch_block_t)completion
|
||||
{
|
||||
OWSPrimaryStorage *primaryStorage = [OWSPrimaryStorage sharedManager];
|
||||
YapDatabaseConnection *databaseConnection = primaryStorage.dbReadWriteConnection;
|
||||
YapDatabaseConnection *databaseConnection = [primaryStorage newDatabaseConnection];
|
||||
|
||||
[self auditAndCleanup:shouldRemoveOrphans databaseConnection:databaseConnection completion:completion];
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue