Skip to content

Commit

Permalink
hotfix
Browse files Browse the repository at this point in the history
  • Loading branch information
KenyonY committed Jan 8, 2024
1 parent df045a9 commit 79c16a7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion flaxkv/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

from .core import LevelDBDict, LMDBDict, RemoteDBDict

__version__ = "0.2.3"
__version__ = "0.2.3.1"

__all__ = [
"FlaxKV",
Expand Down
12 changes: 6 additions & 6 deletions flaxkv/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -1171,12 +1171,12 @@ def _get_db_data_dict(self, decode_raw=True):
return_buffer_dict=False, return_view=True, decode_raw=decode_raw
)
data_dict = {}
response: Response = view.client.get(f"/dict?db_name={self._db_name}")
if not response.is_success:
raise ValueError(
f"Failed to get items from remote db: {decode(response.read())}"
)
remote_db_dict = decode(response.read())
with view.client.stream("GET", f"/dict_stream?db_name={self._db_name}") as r:
data_stream = b""
for data in r.iter_bytes():
data_stream += data

remote_db_dict = decode(data_stream)
for dk, dv in remote_db_dict.items():
if dk not in delete_buffer_set:
data_dict[dk] = dv
Expand Down

0 comments on commit 79c16a7

Please sign in to comment.