From fb4e76ba550b7d16988141830e77e9f748ea38fc Mon Sep 17 00:00:00 2001 From: noO0oOo0ob <38344038+noO0oOo0ob@users.noreply.github.com> Date: Mon, 20 May 2024 19:28:34 +0800 Subject: [PATCH] fix dm encode flow make checker msg change (#854) * add deepcopy in dm event_receiver * deepcopy all event * limit deepcopy scope --------- Co-authored-by: noO0ob --- lyrebird/db/database_server.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lyrebird/db/database_server.py b/lyrebird/db/database_server.py index 9cd915dcd..20a10a2d4 100644 --- a/lyrebird/db/database_server.py +++ b/lyrebird/db/database_server.py @@ -3,6 +3,7 @@ import datetime import traceback import time +import copy from queue import Queue from pathlib import Path from lyrebird import application @@ -131,8 +132,9 @@ def _fk_pragma_on_connect(self, dbapi_con, con_record): def event_receiver(self, event, channel=None, event_id=None): # event is decoded , which should be encoded when save - # event is deepcopy when created, no needs to copy again + # deepcopy to avoid affecting checker running if channel == 'flow': + event = copy.deepcopy(event) application.encoders_decoders.encoder_handler(event['flow']) content = json.dumps(event, ensure_ascii=False)