File tree Expand file tree Collapse file tree 2 files changed +7
-7
lines changed Expand file tree Collapse file tree 2 files changed +7
-7
lines changed Original file line number Diff line number Diff line change 19
19
20
20
from .core import LevelDBDict , LMDBDict , RemoteDBDict
21
21
22
- __version__ = "0.2.3"
22
+ __version__ = "0.2.3.1 "
23
23
24
24
__all__ = [
25
25
"FlaxKV" ,
Original file line number Diff line number Diff line change @@ -1171,12 +1171,12 @@ def _get_db_data_dict(self, decode_raw=True):
1171
1171
return_buffer_dict = False , return_view = True , decode_raw = decode_raw
1172
1172
)
1173
1173
data_dict = {}
1174
- response : Response = view .client .get ( f"/dict ?db_name={ self ._db_name } " )
1175
- if not response . is_success :
1176
- raise ValueError (
1177
- f"Failed to get items from remote db: { decode ( response . read ()) } "
1178
- )
1179
- remote_db_dict = decode (response . read () )
1174
+ with view .client .stream ( "GET" , f"/dict_stream ?db_name={ self ._db_name } " ) as r :
1175
+ data_stream = b""
1176
+ for data in r . iter_bytes ():
1177
+ data_stream += data
1178
+
1179
+ remote_db_dict = decode (data_stream )
1180
1180
for dk , dv in remote_db_dict .items ():
1181
1181
if dk not in delete_buffer_set :
1182
1182
data_dict [dk ] = dv
You can’t perform that action at this time.
0 commit comments