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:
@@ -6,6 +6,7 @@ import lombok.Data;
|
||||
public class JobStatus {
|
||||
private ProgressTracker process = new ProgressTracker();
|
||||
private ProgressTracker conversion = new ProgressTracker();
|
||||
private boolean failed = false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -77,7 +77,9 @@ public class ClipService {
|
||||
value,
|
||||
outputFile,
|
||||
inputFile.getName()
|
||||
)));
|
||||
))).exceptionally(ex -> {
|
||||
throw new FFMPEGException("FFMPEG Compression failed: " + ex.getMessage());
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user