This commit is contained in:
2024-10-29 18:29:43 +08:00
parent e6568480b7
commit 129e407646
11 changed files with 132 additions and 113 deletions

View File

@@ -1,5 +1,6 @@
package com.yutou.bilibili.Tools;
import com.yutou.bilibili.services.LiveVideoService;
import com.yutou.bilibili.services.SystemService;
import com.yutou.common.utils.FFmpegUtils;
import com.yutou.common.utils.Log;
@@ -7,15 +8,18 @@ import jakarta.annotation.Resource;
import org.springframework.context.ApplicationListener;
import org.springframework.context.event.ContextClosedEvent;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Service;
@Component
public class ApplicationClose implements ApplicationListener<ContextClosedEvent> {
@Resource
SystemService systemConfigService;
@Resource
LiveVideoService videoService;
@Override
public void onApplicationEvent(ContextClosedEvent contextClosedEvent) {
Log.i("服务结束");
systemConfigService.stop();
FFmpegUtils.killAll();
videoService.stopAll();
}
}