mirror of
https://github.com/logos-storage/nim-datastore.git
synced 2026-02-17 20:23:36 +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/strutils
|
||||
import std/sets
|
||||
import std/sequtils
|
||||
|
||||
import pkg/leveldbstatic
|
||||
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]).} =
|
||||
try:
|
||||
for iter in self.openIterators:
|
||||
for iter in self.openIterators.toSeq:
|
||||
if err =? (await iter.dispose()).errorOption:
|
||||
return failure(err.msg)
|
||||
self.openIterators.clear()
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user