fix: prioritize failed simulation status
This commit is contained in:
parent
867b54cb81
commit
8b414607c7
|
|
@ -519,7 +519,15 @@ const fetchRunStatus = async () => {
|
||||||
// 通过检测 twitter_completed 和 reddit_completed 状态判断
|
// 通过检测 twitter_completed 和 reddit_completed 状态判断
|
||||||
const platformsCompleted = checkPlatformsCompleted(data)
|
const platformsCompleted = checkPlatformsCompleted(data)
|
||||||
|
|
||||||
if (isCompleted || platformsCompleted) {
|
// An explicit runner failure is authoritative. Platform completion flags
|
||||||
|
// can be stale or partial when one subprocess exits successfully before
|
||||||
|
// another subprocess fails, so inferred completion must not mask it.
|
||||||
|
if (isFailed) {
|
||||||
|
addLog(t('log.simFailed') + (data.error ? `: ${data.error}` : ''))
|
||||||
|
phase.value = 2
|
||||||
|
stopPolling()
|
||||||
|
emit('update-status', 'error')
|
||||||
|
} else if (isCompleted || platformsCompleted) {
|
||||||
if (platformsCompleted && !isCompleted) {
|
if (platformsCompleted && !isCompleted) {
|
||||||
addLog(t('log.allPlatformsCompleted'))
|
addLog(t('log.allPlatformsCompleted'))
|
||||||
}
|
}
|
||||||
|
|
@ -527,11 +535,6 @@ const fetchRunStatus = async () => {
|
||||||
phase.value = 2
|
phase.value = 2
|
||||||
stopPolling()
|
stopPolling()
|
||||||
emit('update-status', 'completed')
|
emit('update-status', 'completed')
|
||||||
} else if (isFailed) {
|
|
||||||
addLog(t('log.simFailed') + (data.error ? `: ${data.error}` : ''))
|
|
||||||
phase.value = 2
|
|
||||||
stopPolling()
|
|
||||||
emit('update-status', 'error')
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
|
|
@ -1270,4 +1273,4 @@ onUnmounted(() => {
|
||||||
animation: spin 0.8s linear infinite;
|
animation: spin 0.8s linear infinite;
|
||||||
margin-right: 6px;
|
margin-right: 6px;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue