调整数据库全部走LiveDatabaseServer

This commit is contained in:
2024-11-29 10:42:47 +08:00
parent 8afb8f8f0b
commit 5ae1b474f9
12 changed files with 75 additions and 58 deletions

View File

@@ -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();
}
}