Skip to content

Commit

Permalink
fix dm encode flow make checker msg change (#854)
Browse files Browse the repository at this point in the history
* add deepcopy in dm event_receiver

* deepcopy all event

* limit deepcopy scope

---------

Co-authored-by: noO0ob <[email protected]>
  • Loading branch information
noO0oOo0ob and noO0ob authored May 20, 2024
1 parent a70e212 commit fb4e76b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lyrebird/db/database_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import datetime
import traceback
import time
import copy
from queue import Queue
from pathlib import Path
from lyrebird import application
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit fb4e76b

Please sign in to comment.