mirror of
https://github.com/omnivore-app/omnivore.git
synced 2026-03-11 08:54:26 +00:00
Delay loading of the background context
This commit is contained in:
parent
f95c76ff8f
commit
8a288ffe5f
1 changed files with 4 additions and 4 deletions
|
|
@ -60,16 +60,16 @@ public final class DataService: ObservableObject {
|
|||
self.appEnvironment = appEnvironment
|
||||
self.networker = networker
|
||||
self.persistentContainer = PersistentContainer.make()
|
||||
self.backgroundContext = persistentContainer.newBackgroundContext()
|
||||
|
||||
backgroundContext.automaticallyMergesChangesFromParent = true
|
||||
backgroundContext.mergePolicy = NSMergePolicy.mergeByPropertyObjectTrump
|
||||
|
||||
persistentContainer.loadPersistentStores { _, error in
|
||||
if let error = error {
|
||||
fatalError("Core Data store failed to load with error: \(error)")
|
||||
}
|
||||
}
|
||||
self.backgroundContext = persistentContainer.newBackgroundContext()
|
||||
|
||||
backgroundContext.automaticallyMergesChangesFromParent = true
|
||||
backgroundContext.mergePolicy = NSMergePolicy.mergeByPropertyObjectTrump
|
||||
}
|
||||
|
||||
public func cleanupDeletedItems(in context: NSManagedObjectContext) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue