mirror of
https://github.com/logos-storage/logos-storage-nim.git
synced 2026-01-20 22:33:10 +00:00
DEBUG: check CacheStore.getBlock w/o catch
This commit is contained in:
parent
09d3e22ddf
commit
5fd449e865
@ -55,16 +55,10 @@ method getBlock*(
|
||||
trace "Empty block, ignoring"
|
||||
return cid.emptyBlock.success
|
||||
|
||||
# if cid notin self.cache:
|
||||
# return Block.failure("Block not found") # TODO: return nil
|
||||
if cid notin self.cache:
|
||||
return Block.failure("Block not found") # TODO: return nil
|
||||
|
||||
try:
|
||||
let x = self.cache[cid]
|
||||
return x.success
|
||||
except CatchableError as e:
|
||||
return Block.failure(e)
|
||||
|
||||
# return self.cache[cid].catch()
|
||||
return self.cache[cid]
|
||||
|
||||
method hasBlock*(self: CacheStore, cid: Cid): Future[?!bool] {.async.} =
|
||||
## Check if the block exists in the blockstore
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user