调整一下切片逻辑

This commit is contained in:
2025-06-17 14:12:43 +08:00
parent fae62ab7c2
commit b0c8643e92

View File

@ -181,14 +181,11 @@ public class VideoPieceGetter {
.map(Map.Entry::getKey).forEach(pairDeviceId -> {
log.info("找到同景区关联设备:{} -> {}", pairDeviceId, faceSample.getDeviceId());
if (pairDeviceId != null) {
executor.execute(() -> {
doCut(pairDeviceId, faceSample.getId(), faceSample.getCreateAt(), task);
currentUnFinPlaceholder.remove(faceSample.getDeviceId().toString());
});
}
});
}
executor.execute(() -> {
doCut(faceSample.getDeviceId(), faceSample.getId(), faceSample.getCreateAt(), task);
currentUnFinPlaceholder.remove(faceSample.getDeviceId().toString());
if (templatePlaceholder != null) {
@ -203,13 +200,13 @@ public class VideoPieceGetter {
});
});
});
});
try {
Thread.sleep(1000L);
log.info("executor等待被结束![A:{}/T:{}/F:{}]", executor.getActiveCount(), executor.getTaskCount(), executor.getCompletedTaskCount());
executor.shutdown();
executor.awaitTermination(5, TimeUnit.MINUTES);
log.info("executor已结束![A:{}/T:{}/F:{}]", executor.getActiveCount(), executor.getTaskCount(), executor.getCompletedTaskCount());
executor.close();
} catch (InterruptedException e) {
return;
} finally {