From 181168d0738bb3ac66ee630099873fef39e5a29a Mon Sep 17 00:00:00 2001 From: Dmitriy Ryajov Date: Tue, 19 Sep 2023 19:03:40 -0600 Subject: [PATCH] fix tired ds --- datastore/tieredds.nim | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/datastore/tieredds.nim b/datastore/tieredds.nim index 4eca23b..8448f9b 100644 --- a/datastore/tieredds.nim +++ b/datastore/tieredds.nim @@ -74,13 +74,16 @@ method get*( bytes: seq[byte] for store in self.stores: - without bytes =? (await store.get(key)): - continue + without bytes =? (await store.get(key)), err: + if err of DatastoreKeyNotFound: + continue + else: + return failure(err) if bytes.len <= 0: continue - # put found data into stores logically in front of the current store + # put found data into stores in front of the current store for s in self.stores: if s == store: break if( @@ -88,7 +91,10 @@ method get*( res.isErr): return failure res.error - return success bytes + if bytes.len > 0: + return success bytes + + return failure (ref DatastoreKeyNotFound)(msg: "Key not found") method put*( self: TieredDatastore,