diff --git a/MastodonSDK/Sources/CoreDataStack/Extension/NSManagedObjectContext.swift b/MastodonSDK/Sources/CoreDataStack/Extension/NSManagedObjectContext.swift index 06906fc654..3b48189928 100644 --- a/MastodonSDK/Sources/CoreDataStack/Extension/NSManagedObjectContext.swift +++ b/MastodonSDK/Sources/CoreDataStack/Extension/NSManagedObjectContext.swift @@ -35,7 +35,7 @@ extension NSManagedObjectContext { public func performChanges(block: @escaping () -> Void) -> Future, Never> { Future { promise in - self.performAndWait { + self.perform { block() do { try self.saveOrRollback() @@ -50,13 +50,13 @@ extension NSManagedObjectContext { extension NSManagedObjectContext { public func perform(block: @escaping () throws -> T) async throws -> T { - return try performAndWait { + return try await perform(schedule: .enqueued) { try block() } } public func performChanges(block: @escaping () throws -> T) async throws -> T { - return try performAndWait { + return try await perform(schedule: .enqueued) { let value = try block() try self.saveOrRollback() return value