Skip to content

Commit 3282459

Browse files
committed
Revert "Perform changes synchronously (#940)"
This reverts commit 6e8d1e3.
1 parent 6e8d1e3 commit 3282459

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

MastodonSDK/Sources/CoreDataStack/Extension/NSManagedObjectContext.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ extension NSManagedObjectContext {
3535

3636
public func performChanges(block: @escaping () -> Void) -> Future<Result<Void, Error>, Never> {
3737
Future { promise in
38-
self.performAndWait {
38+
self.perform {
3939
block()
4040
do {
4141
try self.saveOrRollback()
@@ -50,13 +50,13 @@ extension NSManagedObjectContext {
5050

5151
extension NSManagedObjectContext {
5252
public func perform<T>(block: @escaping () throws -> T) async throws -> T {
53-
return try performAndWait {
53+
return try await perform(schedule: .enqueued) {
5454
try block()
5555
}
5656
}
5757

5858
public func performChanges<T>(block: @escaping () throws -> T) async throws -> T {
59-
return try performAndWait {
59+
return try await perform(schedule: .enqueued) {
6060
let value = try block()
6161
try self.saveOrRollback()
6262
return value

0 commit comments

Comments
 (0)