initial take at making fsds synchronous

This commit is contained in:
Jaremy Creechley 2023-09-26 21:30:59 -07:00
parent bb9e343e9f
commit 235232a84f
No known key found for this signature in database
GPG Key ID: 4E66FB67B21D3300

View File

@ -184,7 +184,8 @@ proc query*(
self: FSDatastore, self: FSDatastore,
query: DbQuery[KeyId]): ?!QueryIter = query: DbQuery[KeyId]): ?!QueryIter =
without path =? self.path(query.key), error: let key = query.key.toKey()
without path =? self.path(key), error:
return failure error return failure error
let basePath = let basePath =
@ -236,7 +237,7 @@ proc query*(
key = Key.init(keyPath).expect("should not fail") key = Key.init(keyPath).expect("should not fail")
data = data =
if query.value: if query.value:
self.readFile[DataBuffer]((basePath / path).absolutePath) readFile[DataBuffer](self, (basePath / path).absolutePath)
.expect("Should read file") .expect("Should read file")
else: else:
@[] @[]