fixbug
This commit is contained in:
parent
666d6eb048
commit
ae60040120
@ -18,6 +18,9 @@ class UserConfigOper(DbOper, metaclass=Singleton):
|
|||||||
"""
|
"""
|
||||||
super().__init__()
|
super().__init__()
|
||||||
for item in UserConfig.list(self._db):
|
for item in UserConfig.list(self._db):
|
||||||
|
if ObjectUtils.is_obj(item.value):
|
||||||
|
self.__set_config_cache(user_id=item.user_id, key=item.key, value=json.loads(item.value))
|
||||||
|
else:
|
||||||
self.__set_config_cache(user_id=item.user_id, key=item.key, value=item.value)
|
self.__set_config_cache(user_id=item.user_id, key=item.key, value=item.value)
|
||||||
|
|
||||||
def set(self, user_id: int, key: Union[str, UserConfigKey], value: Any):
|
def set(self, user_id: int, key: Union[str, UserConfigKey], value: Any):
|
||||||
@ -72,9 +75,6 @@ class UserConfigOper(DbOper, metaclass=Singleton):
|
|||||||
if not user_cache:
|
if not user_cache:
|
||||||
user_cache = {}
|
user_cache = {}
|
||||||
cache[user_id] = user_cache
|
cache[user_id] = user_cache
|
||||||
if ObjectUtils.is_obj(value):
|
|
||||||
user_cache[key] = json.loads(value)
|
|
||||||
else:
|
|
||||||
user_cache[key] = value
|
user_cache[key] = value
|
||||||
self.__USERCONF = cache
|
self.__USERCONF = cache
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user