mirror of
https://github.com/TheWhiteDog9487/WebAPI.git
synced 2026-08-11 23:01:30 +08:00
由于Systemd服务文件管理逻辑运行于Spring程序启动之前,现在已经不需要刻意拦截Discord Bean的启动了
This commit is contained in:
@@ -30,7 +30,7 @@ import java.util.Map;
|
||||
@RestController
|
||||
@RequestMapping("/message")
|
||||
class Message {
|
||||
@Lazy @Autowired GatewayDiscordClient DiscordBotClient;
|
||||
@Autowired GatewayDiscordClient DiscordBotClient;
|
||||
@Autowired List<String> ApiKeyList;
|
||||
|
||||
@Schema(description = "包含了发送消息的数据包")
|
||||
|
||||
@@ -18,7 +18,6 @@ import java.util.List;
|
||||
@Component
|
||||
class GlobalSharedBean {
|
||||
|
||||
@Lazy
|
||||
@Bean
|
||||
GatewayDiscordClient GetDiscordClient(){
|
||||
String DiscordBotToken = System.getenv("Discord_Bot_Token");
|
||||
|
||||
@@ -174,6 +174,5 @@ public class SystemdInstallerManager{
|
||||
log.info("成功删除指向程序自身的软链接: {}", SymbolicLinkPath);
|
||||
new ProcessBuilder("systemctl", "daemon-reload").start().waitFor();
|
||||
log.info("已完成systemd守护进程重载"); }
|
||||
System.exit(0); } }
|
||||
// ↓ 并不是安装或卸载服务,于是继续正常的启动程序,让Discord客户端连接服务器,校验API密钥是否正确并确保密钥非空
|
||||
DiscordClientProvider.getIfAvailable(); } }
|
||||
System.exit(0); } } }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user