Fix a race condition when creating config.key_to_id
This commit is contained in:
parent
fc7a3a7f51
commit
8409378e00
@ -68,9 +68,9 @@ class ConfigHandler:
|
|||||||
This uses the element_cache. It expects, that the config values are in the database
|
This uses the element_cache. It expects, that the config values are in the database
|
||||||
before this is called.
|
before this is called.
|
||||||
"""
|
"""
|
||||||
self.key_to_id = {}
|
|
||||||
all_data = await element_cache.get_all_full_data()
|
all_data = await element_cache.get_all_full_data()
|
||||||
elements = all_data[self.get_collection_string()]
|
elements = all_data[self.get_collection_string()]
|
||||||
|
self.key_to_id = {}
|
||||||
for element in elements:
|
for element in elements:
|
||||||
self.key_to_id[element["key"]] = element["id"]
|
self.key_to_id[element["key"]] = element["id"]
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user