PyDbLite
PyDbLite copied to clipboard
Problems under multithreading
KeyError occurs when multiple threads execute the following code at the same time.
for i in range(1, 100 * (10 ** n)):
common.ram.insert(uuid=i)
common.ram._uuid[i]
` File "/Users/neo/work/socket_server/service/main.py", line 72, in message common.ram._uuid[i]
File "/Users/neo/work/socket_server/venvs/rsa_plugins/lib/python3.6/site-packages/pydblite/pydblite.py", line 104, in getitem return [self.db.records[_id] for _id in ids]
File "/Users/neo/work/socket_server/venvs/rsa_plugins/lib/python3.6/site-packages/pydblite/pydblite.py", line 104, in