主动建thread

This commit is contained in:
Jerry Yan 2025-03-03 18:08:31 +08:00
parent 1ba4e6a9c3
commit ee7249d63b

View File

@ -123,10 +123,8 @@ public class VideoPieceGetter {
})
.collect(Collectors.groupingBy(FaceSampleEntity::getDeviceId))
.values();
collection
.stream()
.parallel()
.forEach(faceSampleList -> {
collection.forEach(faceSampleList -> {
new Thread(() -> {
faceSampleList.parallelStream().forEach(faceSample -> {
DeviceEntity device = deviceRepository.getDevice(faceSample.getDeviceId());
DeviceConfigEntity config = deviceRepository.getDeviceConfig(faceSample.getDeviceId());
@ -254,6 +252,7 @@ public class VideoPieceGetter {
}
}
});
}).start();
});
if (task.faceId != null) {
taskStatusBiz.setFaceCutStatus(task.faceId, 1);