mirror of
https://github.com/logos-storage/nim-datastore.git
synced 2026-07-31 03:43:28 +00:00
snapshot set before modifying
This commit is contained in:
parent
6bc45b0f53
commit
c3b52cd4ec
@ -6,6 +6,7 @@ import std/os
|
|||||||
import std/strformat
|
import std/strformat
|
||||||
import std/strutils
|
import std/strutils
|
||||||
import std/sets
|
import std/sets
|
||||||
|
import std/sequtils
|
||||||
|
|
||||||
import pkg/leveldbstatic
|
import pkg/leveldbstatic
|
||||||
import pkg/chronos
|
import pkg/chronos
|
||||||
@ -75,7 +76,7 @@ method put*(self: LevelDbDatastore, batch: seq[BatchEntry]): Future[?!void] {.as
|
|||||||
|
|
||||||
method close*(self: LevelDbDatastore): Future[?!void] {.async: (raises: [CancelledError]).} =
|
method close*(self: LevelDbDatastore): Future[?!void] {.async: (raises: [CancelledError]).} =
|
||||||
try:
|
try:
|
||||||
for iter in self.openIterators:
|
for iter in self.openIterators.toSeq:
|
||||||
if err =? (await iter.dispose()).errorOption:
|
if err =? (await iter.dispose()).errorOption:
|
||||||
return failure(err.msg)
|
return failure(err.msg)
|
||||||
self.openIterators.clear()
|
self.openIterators.clear()
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user