Skip to content

Commit fce01ab

Browse files
author
DomHudson
authored
Merge pull request #9 from ThoughtRiver/bug-fix-prevent-lock-errors
Bug fix: Changing lock to default to false on the LmdbReader
2 parents 664739c + fec0973 commit fce01ab

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

lmdb_embeddings/reader.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626

2727
class LmdbEmbeddingsReader:
2828

29-
def __init__(self, path, unserializer = PickleSerializer.unserialize):
29+
def __init__(self, path, unserializer = PickleSerializer.unserialize, **kwargs):
3030
""" Constructor.
3131
3232
:return void
@@ -36,7 +36,9 @@ def __init__(self, path, unserializer = PickleSerializer.unserialize):
3636
path,
3737
readonly = True,
3838
max_readers = 2048,
39-
max_spare_txns = 2
39+
max_spare_txns = 2,
40+
lock = kwargs.pop('lock', False),
41+
**kwargs
4042
)
4143

4244
def get_word_vector(self, word):

0 commit comments

Comments
 (0)