Skip to content

Commit

Permalink
Try to fix actor-isolation error on GitHub test
Browse files Browse the repository at this point in the history
  • Loading branch information
marcoarment committed Oct 25, 2023
1 parent 9e189fd commit b90d663
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions Sources/Blackbird/BlackbirdModelSearch.swift
Original file line number Diff line number Diff line change
Expand Up @@ -408,8 +408,13 @@ fileprivate struct DecodedStructuredFTSQuery<T: BlackbirdModel>: Sendable {
}

func query(in database: Blackbird.Database, core: isolated Blackbird.Database.Core) throws -> [BlackbirdModelSearchResult<T>] {
try T.queryIsolated(in: database, core: core, query, arguments: arguments)
.compactMap { try result(database: database, core: core, ftsRow: $0) }
var results: [BlackbirdModelSearchResult<T>] = []
for row in try T.queryIsolated(in: database, core: core, query, arguments: arguments) {
if let result = try result(database: database, core: core, ftsRow: row) {
results.append(result)
}
}
return results
}

func result(database: Blackbird.Database, core: isolated Blackbird.Database.Core, ftsRow: Blackbird.ModelRow<T>) throws -> BlackbirdModelSearchResult<T>? {
Expand Down

0 comments on commit b90d663

Please sign in to comment.