0.12.0-13 Job Log fix
This commit is contained in:
@@ -960,19 +960,15 @@ export default function DashboardPage({
|
||||
const state = String(pipeline?.state || 'IDLE').trim().toUpperCase();
|
||||
const currentPipelineJobId = normalizeJobId(pipeline?.activeJobId || pipeline?.context?.jobId);
|
||||
const isProcessing = processingStates.includes(state);
|
||||
// When the pipeline transitions to METADATA_SELECTION for a new job while another job
|
||||
// is still encoding in the background, isProcessing becomes false and the log clears.
|
||||
// Track the background encoding job so its live log keeps polling.
|
||||
const backgroundProcessingJobId = useMemo(() => {
|
||||
if (isProcessing) return null;
|
||||
const bg = dashboardJobs.find((job) => {
|
||||
const s = normalizeStatus(job?.status);
|
||||
return processingStates.includes(s);
|
||||
});
|
||||
// Always prefer the ENCODING job from dashboardJobs for the live log.
|
||||
// When a second job enters ANALYZING, isProcessing becomes true (ANALYZING is a processingState)
|
||||
// and currentPipelineJobId switches to job2 — but job1 is still ENCODING and its log must stay visible.
|
||||
const encodingJobId = useMemo(() => {
|
||||
const bg = dashboardJobs.find((job) => normalizeStatus(job?.status) === 'ENCODING');
|
||||
return bg ? normalizeJobId(bg.id) : null;
|
||||
}, [isProcessing, dashboardJobs]);
|
||||
const liveLogJobId = backgroundProcessingJobId || currentPipelineJobId;
|
||||
const liveLogActive = isProcessing || Boolean(backgroundProcessingJobId);
|
||||
}, [dashboardJobs]);
|
||||
const liveLogJobId = encodingJobId || currentPipelineJobId;
|
||||
const liveLogActive = isProcessing || Boolean(encodingJobId);
|
||||
const monitoringState = useMemo(
|
||||
() => normalizeHardwareMonitoringPayload(hardwareMonitoring),
|
||||
[hardwareMonitoring]
|
||||
|
||||
Reference in New Issue
Block a user