From dc9a54e74f5586460c881c70aa6fb7b0ecbc0368 Mon Sep 17 00:00:00 2001 From: InfinityPacer <160988576+InfinityPacer@users.noreply.github.com> Date: Sat, 25 Jan 2025 00:32:42 +0800 Subject: [PATCH] fix(command): ensure command data isolation by using deepcopy --- app/command.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/command.py b/app/command.py index 3d581efd..aa96ff74 100644 --- a/app/command.py +++ b/app/command.py @@ -1,3 +1,4 @@ +import copy import threading import traceback from typing import Any, Union, Dict, Optional @@ -303,7 +304,7 @@ class Command(metaclass=Singleton): ) else: # 命令 - cmd_data = command['data'] if command.get('data') else {} + cmd_data = copy.deepcopy(command['data']) if command.get('data') else {} args_num = ObjectUtils.arguments(command['func']) if args_num > 0: if cmd_data: