From afa47c3ff3187aa82d20bd645c37d492472d6d89 Mon Sep 17 00:00:00 2001 From: SerLiunx-ctrl <17689543@qq.com> Date: Mon, 20 Jan 2025 14:41:56 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E6=8C=87=E4=BB=A4=E8=B0=83=E5=BA=A6?= =?UTF-8?q?=E5=A4=9A=E7=BA=BF=E7=A8=8B=E9=80=BB=E8=BE=91=E5=BC=82=E5=B8=B8?= =?UTF-8?q?.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../serliunx/ddns/support/command/CommandDispatcher.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/serliunx/ddns/support/command/CommandDispatcher.java b/src/main/java/com/serliunx/ddns/support/command/CommandDispatcher.java index 1d96795..25419ec 100644 --- a/src/main/java/com/serliunx/ddns/support/command/CommandDispatcher.java +++ b/src/main/java/com/serliunx/ddns/support/command/CommandDispatcher.java @@ -38,22 +38,25 @@ public final class CommandDispatcher { /** * 指令注册 + * * @param command 指令 */ - public void register(Command command) { + public synchronized void register(Command command) { commands.put(command.getName(), command); } /** * 指令反注册 + * * @param command 指令 */ - public void unregister(Command command) { + public synchronized void unregister(Command command) { commands.remove(command.getName()); } /** * 处理输入的指令 + * * @param input 指令 */ public void onCommand(String input) {