This commit is contained in:
孙小云 2025-01-13 13:49:02 +08:00
parent b27fe436c9
commit ea7bef8368
1 changed files with 3 additions and 1 deletions

View File

@ -1,5 +1,6 @@
package com.tuoheng.steam.service;
import com.alibaba.fastjson2.JSON;
import com.tuoheng.steam.dos.StreamProcess;
import com.tuoheng.steam.dos.StreamTask;
import com.tuoheng.steam.service.innerService.ProcessService;
@ -35,7 +36,8 @@ public class TaskService implements ITaskService{
public void cleaTask() {
for (ConcurrentHashMap.Entry<String, StreamTask> entry : runningTasks.entrySet()) {
StreamTask streamTask = entry.getValue();
if(streamTask.getStartTime().getTime() < new Date().getTime() - 60 * 20 *60 ) {
if(streamTask.getStartTime().getTime() < new Date().getTime() - 30 * 60 * 1000 ) {
logger.info("清理废弃任务 {}", JSON.toJSONString(streamTask));
StreamTask s = stopTask(entry.getKey());
scheduler.schedule(() -> {
File file = new File(targetPath +"/"+ s.getOutFileName());