This commit is contained in:
beabigegg
2025-08-17 17:58:54 +08:00
parent 957743d83a
commit 9a263b6afb
4 changed files with 10 additions and 2 deletions

View File

@@ -93,7 +93,14 @@ const ProcessingPage = () => {
const intervalId = setInterval(async () => {
try {
const updatedTask = await pollTaskStatus(task.status_url);
// Pass the full task object to avoid stale closures
// FIX: Check for inner 'Error' status even if Celery task state is 'SUCCESS'
if (updatedTask.state === 'SUCCESS' && updatedTask.info?.status === 'Error') {
handleTaskUpdate(key, { ...task, state: 'FAILURE', info: { ...task.info, error: updatedTask.info.error || 'Task failed with an unknown error.' } });
clearInterval(intervalId);
return;
}
handleTaskUpdate(key, { ...task, ...updatedTask });
if (['SUCCESS', 'FAILURE', 'REVOKED'].includes(updatedTask.state)) {
clearInterval(intervalId);