fix5
This commit is contained in:
@@ -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);
|
||||
|
Reference in New Issue
Block a user