mirror of
https://github.com/logos-storage/logos-storage-nim.git
synced 2026-02-21 14:03:08 +00:00
add logs
This commit is contained in:
parent
8ebe766599
commit
b854053a5c
@ -320,9 +320,12 @@ proc asyncEncode*(
|
||||
): Future[?!seq[seq[byte]]] {.async: (raises: [CancelledError]).} =
|
||||
without threadPtr =? ThreadSignalPtr.new():
|
||||
return failure("Unable to create thread signal")
|
||||
|
||||
echo "In Async Encode"
|
||||
defer:
|
||||
threadPtr.close().expect("closing once works")
|
||||
if threadPtr != nil:
|
||||
?threadPtr.close().mapFailure()
|
||||
threadPtr = nil
|
||||
echo "Out Async Encode"
|
||||
|
||||
## Create an ecode task with block data
|
||||
var task = EncodeTask(
|
||||
@ -482,9 +485,12 @@ proc asyncDecode*(
|
||||
): Future[?!seq[seq[byte]]] {.async: (raises: [CancelledError]).} =
|
||||
without threadPtr =? ThreadSignalPtr.new():
|
||||
return failure("Unable to create thread signal")
|
||||
|
||||
echo "In Async Decode"
|
||||
defer:
|
||||
threadPtr.close().expect("closing once works")
|
||||
if threadPtr != nil:
|
||||
?threadPtr.close().mapFailure()
|
||||
threadPtr = nil
|
||||
echo "Out Async Decode"
|
||||
|
||||
## Create an decode task with block data
|
||||
var task = DecodeTask(
|
||||
@ -507,12 +513,12 @@ proc asyncDecode*(
|
||||
|
||||
return failure(err)
|
||||
|
||||
defer:
|
||||
task.recovered = default(Isolated[seq[seq[byte]]])
|
||||
|
||||
if not task.success.load():
|
||||
return failure("Leopard decoding task failed")
|
||||
|
||||
defer:
|
||||
task.recovered = default(Isolated[seq[seq[byte]]])
|
||||
|
||||
var recovered = task.recovered.extract
|
||||
|
||||
success(recovered)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user