Skip to content

Commit

Permalink
Enable independent memory repo
Browse files Browse the repository at this point in the history
  • Loading branch information
davidlatwe committed Jul 22, 2023
1 parent 8e00af1 commit 9c621f1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion montydb/configure.py
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ def provide_storage(repository):
A Subclass of `montydb.storage.abcs.AbstractStorage`
"""
if repository == MEMORY_REPOSITORY:
if repository.startswith(MEMORY_REPOSITORY):
storage_name = MEMORY_STORAGE
if not memory.is_memory_storage_set():
set_storage(repository, storage_name)
Expand Down
6 changes: 3 additions & 3 deletions montydb/storage/memory.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

from itertools import islice
from collections import OrderedDict
from collections import defaultdict, OrderedDict

from ..types import bson
from . import (
Expand All @@ -13,7 +13,7 @@
)


_repo = OrderedDict()
_repos = defaultdict(OrderedDict)
_config = {"_": {}}


Expand All @@ -27,7 +27,7 @@ class MemoryStorage(AbstractStorage):

def __init__(self, repository, storage_config):
super(MemoryStorage, self).__init__(repository, storage_config)
self._repo = _repo
self._repo = _repos[repository]

@classmethod
def nice_name(cls):
Expand Down

0 comments on commit 9c621f1

Please sign in to comment.