From c63217f0c64cd47ba856e5c2fe453bb953717036 Mon Sep 17 00:00:00 2001 From: Eyre_S Date: Sun, 5 Jun 2022 20:06:13 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=BA=E5=90=AF=E5=8A=A8=E7=BA=BF=E7=A8=8B?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E4=BA=86=20morny-init=20=E8=8A=82=E7=82=B9?= =?UTF-8?q?=EF=BC=8C=E4=BF=AE=E6=94=B9=E7=BA=BF=E7=A8=8B=E5=90=8D=EF=BC=8C?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E4=BA=8B=E4=BB=B6=E7=9B=91=E5=90=AC=E5=90=AF?= =?UTF-8?q?=E5=8A=A8=E7=9A=84log?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 为事件监听器的注册和开启添加一条 log 记录 - 在 ServerMain 交接启动给 MornyCoeur 时将启动线程名切换为 - 将 exit-cleaning 线程名改为小写 --- gradle.properties | 2 +- .../java/cc/sukazyo/cono/morny/GradleProjectConfigures.java | 4 ++-- src/main/java/cc/sukazyo/cono/morny/MornyCoeur.java | 3 ++- src/main/java/cc/sukazyo/cono/morny/ServerMain.java | 3 +++ 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/gradle.properties b/gradle.properties index f9896ea..a990ed9 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,6 +1,6 @@ ## Core -VERSION = 0.7.1.0 +VERSION = 0.7.1.1 CODENAME = fuzhou diff --git a/src/main/java/cc/sukazyo/cono/morny/GradleProjectConfigures.java b/src/main/java/cc/sukazyo/cono/morny/GradleProjectConfigures.java index b0888fc..107cd31 100644 --- a/src/main/java/cc/sukazyo/cono/morny/GradleProjectConfigures.java +++ b/src/main/java/cc/sukazyo/cono/morny/GradleProjectConfigures.java @@ -4,7 +4,7 @@ package cc.sukazyo.cono.morny; * the final field that will be updated by gradle automatically. */ public class GradleProjectConfigures { - public static final String VERSION = "0.7.1.0"; + public static final String VERSION = "0.7.1.1"; public static final String CODENAME = "fuzhou"; - public static final long COMPILE_TIMESTAMP = 1654235503515L; + public static final long COMPILE_TIMESTAMP = 1654430498871L; } diff --git a/src/main/java/cc/sukazyo/cono/morny/MornyCoeur.java b/src/main/java/cc/sukazyo/cono/morny/MornyCoeur.java index ac5a6dd..d2cb07e 100644 --- a/src/main/java/cc/sukazyo/cono/morny/MornyCoeur.java +++ b/src/main/java/cc/sukazyo/cono/morny/MornyCoeur.java @@ -152,6 +152,7 @@ public class MornyCoeur { isRemoveCommandListWhenExit ); MornyDaemons.start(); + logger.info("start telegram events listening"); EventListeners.registerAllListeners(); INSTANCE.account.setUpdatesListener(OnUpdate::onNormalUpdate); if (isAutomaticResetCommandList) { @@ -187,7 +188,7 @@ public class MornyCoeur { * 为程序在虚拟机上添加退出钩子 */ private void configureSafeExit () { - Runtime.getRuntime().addShutdownHook(new Thread(this::exitCleanup, "Exit-Cleaning")); + Runtime.getRuntime().addShutdownHook(new Thread(this::exitCleanup, "exit-cleaning")); } /** diff --git a/src/main/java/cc/sukazyo/cono/morny/ServerMain.java b/src/main/java/cc/sukazyo/cono/morny/ServerMain.java index d7ec325..9f58547 100644 --- a/src/main/java/cc/sukazyo/cono/morny/ServerMain.java +++ b/src/main/java/cc/sukazyo/cono/morny/ServerMain.java @@ -21,6 +21,8 @@ public class ServerMain { public static final String PROP_TOKEN_KEY = "TELEGRAM_BOT_API_TOKEN"; public static final String PROP_TOKEN_MORNY_KEY = "MORNY_TG_TOKEN"; + private static final String THREAD_MORNY_INIT = "morny-init"; + /** * 程序入口,也是参数处理器
*
@@ -233,6 +235,7 @@ public class ServerMain { logger.info("Parameter required has no value:\n --token."); return; } + Thread.currentThread().setName(THREAD_MORNY_INIT); MornyCoeur.main( api, api4File, key, username,