diff --git a/LeStorage/Store.swift b/LeStorage/Store.swift index b47b021..c295f57 100644 --- a/LeStorage/Store.swift +++ b/LeStorage/Store.swift @@ -211,7 +211,7 @@ open class Store { } self._validIds.append(contentsOf: filtered.map { $0.stringId }) - try? collection.addOrUpdate(contentOfs: filtered) + try? collection.addOrUpdateNoSync(contentOfs: filtered) Logger.log("Migrated \(filtered.count) \(T.resourceName())") } diff --git a/LeStorage/StoredCollection.swift b/LeStorage/StoredCollection.swift index 1d7d10c..32d4d57 100644 --- a/LeStorage/StoredCollection.swift +++ b/LeStorage/StoredCollection.swift @@ -304,6 +304,10 @@ public class StoredCollection: RandomAccessCollection, SomeCollecti try self._addOrUpdate(contentOfs: sequence) } + func addOrUpdateNoSync(contentOfs sequence: any Sequence) throws { + try self._addOrUpdate(contentOfs: sequence, shouldSync: false) + } + /// Inserts or updates all items in the sequence fileprivate func _addOrUpdate(contentOfs sequence: any Sequence, shouldSync: Bool = true) throws { defer {