调整数据库全部走LiveDatabaseServer
This commit is contained in:
@@ -1,9 +1,11 @@
|
||||
package com.yutou.bilibili.Tools;
|
||||
|
||||
import com.yutou.bilibili.services.LiveDatabasesService;
|
||||
import com.yutou.bilibili.services.LiveVideoDownloadService;
|
||||
import com.yutou.bilibili.services.SystemService;
|
||||
import com.yutou.common.utils.Log;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.springframework.context.ApplicationListener;
|
||||
import org.springframework.context.event.ContextClosedEvent;
|
||||
import org.springframework.stereotype.Component;
|
||||
@@ -14,10 +16,14 @@ public class ApplicationClose implements ApplicationListener<ContextClosedEvent>
|
||||
SystemService systemConfigService;
|
||||
@Resource
|
||||
LiveVideoDownloadService videoService;
|
||||
@Resource
|
||||
LiveDatabasesService databasesService;
|
||||
|
||||
@Override
|
||||
public void onApplicationEvent(ContextClosedEvent contextClosedEvent) {
|
||||
public void onApplicationEvent(@NotNull ContextClosedEvent contextClosedEvent) {
|
||||
Log.i("服务结束");
|
||||
systemConfigService.stop();
|
||||
videoService.stopAll();
|
||||
databasesService.closeAll();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user