You've already forked FrameTour-BE
fix(video): 调整视频处理任务参数以优化性能
- 将探测大小从 32M 减小到 16M 以减少内存占用 - 修改线程池关闭前的等待时间从 5 分钟缩短至 3 分钟 - 添加注释说明批量定时停止的目的
This commit is contained in:
@@ -84,7 +84,7 @@ public class VideoPieceGetter {
|
||||
@Autowired
|
||||
private MemberRelationRepository memberRelationRepository;
|
||||
|
||||
public static final String PROBE_SIZE = "32M";
|
||||
public static final String PROBE_SIZE = "16M";
|
||||
|
||||
@Data
|
||||
public static class Task {
|
||||
@@ -141,6 +141,7 @@ public class VideoPieceGetter {
|
||||
// taskStatusBiz.setFaceCutStatus(task.faceId, 0);
|
||||
// }
|
||||
AtomicBoolean invoke = new AtomicBoolean(false);
|
||||
// 为了批量定时停止
|
||||
final ThreadFactory threadFactory = new ThreadFactoryBuilder()
|
||||
.setNamePrefix("VPG-" + task.faceId + "-t")
|
||||
.build();
|
||||
@@ -264,7 +265,7 @@ public class VideoPieceGetter {
|
||||
Thread.sleep(1000L);
|
||||
log.info("executor等待被结束![A:{}/T:{}/F:{}]", executor.getActiveCount(), executor.getTaskCount(), executor.getCompletedTaskCount());
|
||||
executor.shutdown();
|
||||
executor.awaitTermination(5, TimeUnit.MINUTES);
|
||||
executor.awaitTermination(3, TimeUnit.MINUTES);
|
||||
log.info("executor已结束![A:{}/T:{}/F:{}]", executor.getActiveCount(), executor.getTaskCount(), executor.getCompletedTaskCount());
|
||||
executor.close();
|
||||
} catch (InterruptedException e) {
|
||||
|
||||
Reference in New Issue
Block a user