ADD job failed attribute to display failed status in API

If a compression processing job fails, the JobStatus object within the Job should update to reflect this fail.
This commit is contained in:
2025-12-15 19:57:00 +00:00
parent f9daef9a4b
commit 92cb9265ca
3 changed files with 7 additions and 1 deletions

View File

@@ -6,6 +6,7 @@ import lombok.Data;
public class JobStatus {
private ProgressTracker process = new ProgressTracker();
private ProgressTracker conversion = new ProgressTracker();
private boolean failed = false;
}

View File

@@ -77,7 +77,9 @@ public class ClipService {
value,
outputFile,
inputFile.getName()
)));
))).exceptionally(ex -> {
throw new FFMPEGException("FFMPEG Compression failed: " + ex.getMessage());
});
}
/**

View File

@@ -7,6 +7,7 @@ import java.nio.file.Paths;
import java.util.concurrent.ConcurrentHashMap;
import com.ddf.vodsystem.dto.Job;
import com.ddf.vodsystem.exceptions.FFMPEGException;
import com.ddf.vodsystem.services.media.RemuxService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -109,6 +110,8 @@ public class JobService {
} catch (IOException | InterruptedException e) {
logger.error("Error processing job {}: {}", job.getUuid(), e.getMessage());
Thread.currentThread().interrupt();
} catch (FFMPEGException e) {
job.getStatus().setFailed(true);
}
}
}