This commit is contained in:
Gwendal Roué committed 2020-03-25 13:05:39 +01:00
1 parent 61e74f9ad4
commit ff2629a31c
1 file changed
+5 -15
+5 -15
View File
@@ -114,9 +114,7 @@ extension ValueObserver: TransactionObserver {
})
} else {
// Concurrent fetch
fetchedValue = writer.concurrentRead {
return try self.reducer.fetch($0)
}
fetchedValue = writer.concurrentRead(reducer.fetch)
}
// Wait for future fetched value in reduceQueue. This guarantees:
@@ -154,21 +152,13 @@ extension ValueObserver {
var region = DatabaseRegion()
let result = try db.recordingSelection(&region, fetch)
// Don't record views, because they are never exposed to the
// TransactionObserver protocol.
//
// Don't record schema introspection queries, which may be
// run, or not, depending on the state of the schema cache.
//
// This gives us a quick way to make sure that the observation
// below, which runs schema introspection queries as a side effect,
// only tracks the "player" table:
//
// let observation = ValueObservation.tracking { db in
// try Player.fetchOne(db, key: 1)
// }
//
// Strictly speaking, this prevents the recording of all schema
// queries. But we assume, until proven wrong, that such recording
// isn't needed by anyone.
observedRegion = try region.ignoringViews(db).ignoringInternalSQLiteTables()
return result
} else {
return try fetch()