Skip to content

Commit 73e07f1

Browse files
committed
perf: Memory optimization
1 parent b8eb7b1 commit 73e07f1

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

apps/application/serializers/common.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@ def map_to_chat_record(chat_record_dict):
272272
index=chat_record_dict.get('index'), )
273273

274274
def set_cache(self):
275-
cache.set(Cache_Version.CHAT.get_key(key=self.chat_id), json.dumps(self.to_dict(), cls=SystemEncoder),
275+
cache.set(Cache_Version.CHAT.get_key(key=self.chat_id), self.to_dict(),
276276
version=Cache_Version.CHAT_INFO.get_version(),
277277
timeout=60 * 30)
278278

@@ -291,5 +291,5 @@ def get_cache(chat_id):
291291
chat_info_dict = cache.get(Cache_Version.CHAT.get_key(key=chat_id),
292292
version=Cache_Version.CHAT_INFO.get_version())
293293
if chat_info_dict:
294-
return ChatInfo.map_to_chat_info(json.loads(chat_info_dict))
294+
return ChatInfo.map_to_chat_info(chat_info_dict)
295295
return None

0 commit comments

Comments
 (0)