File tree Expand file tree Collapse file tree 1 file changed +4
-23
lines changed
Expand file tree Collapse file tree 1 file changed +4
-23
lines changed Original file line number Diff line number Diff line change @@ -424,29 +424,10 @@ extension DatabasePool: DatabaseReader {
424424 throw DatabaseError . connectionIsClosed ( )
425425 }
426426
427- let dbAccess = CancellableDatabaseAccess ( )
428- return try await dbAccess. withCancellableContinuation { continuation in
429- readerPool. asyncGet { result in
430- do {
431- let ( reader, releaseReader) = try result. get ( )
432- // Second async jump because that's how `Pool.async` has to be used.
433- reader. async { db in
434- defer {
435- releaseReader ( . reuse)
436- }
437- do {
438- let result = try dbAccess. inDatabase ( db) {
439- try db. clearSchemaCacheIfNeeded ( )
440- return try value ( db)
441- }
442- continuation. resume ( returning: result)
443- } catch {
444- continuation. resume ( throwing: error)
445- }
446- }
447- } catch {
448- continuation. resume ( throwing: error)
449- }
427+ return try await readerPool. get { reader in
428+ try await reader. execute { db in
429+ try db. clearSchemaCacheIfNeeded ( )
430+ return try value ( db)
450431 }
451432 }
452433 }
You can’t perform that action at this time.
0 commit comments