links in dispose call to leveldb wrapper

This commit is contained in:
benbierens 2024-05-20 09:15:02 +02:00
parent 0c0cb4ac60
commit fc5a6551da
No known key found for this signature in database
GPG Key ID: 877D2C2E09A22F3A
2 changed files with 11 additions and 3 deletions

View File

@ -11,7 +11,7 @@ requires "nim >= 1.2.0",
"chronos#c41599a", # FIXME change to Chronos >= 4.0.0 once it's out
"questionable >= 0.10.15 & < 0.11.0",
"sqlite3_abi",
"leveldbstatic >= 0.1.2",
"leveldbstatic >= 0.1.3",
"stew",
"unittest2"

View File

@ -108,10 +108,18 @@ method query*(
except Exception as e:
return failure("Unknown exception in LevelDbDatastore.query -> next: " & $e.msg)
iter.next = next
iter.dispose = proc(): Future[?!void] {.async.} =
proc dispose(): Future[?!void] {.async.} =
try:
dbIter.dispose()
return success()
except LevelDbException as e:
return failure("LevelDbDatastore.query -> dispose exception: " & $e.msg)
except Exception as e:
return failure("Unknown exception in LevelDbDatastore.query -> dispose: " & $e.msg)
return success()
iter.next = next
iter.dispose = dispose
return success iter
method modifyGet*(