Stop job polling on error (404) to prevent infinite poll loop
When the poll request fails (e.g. job not found 404), clear the activeJob state and stop the interval instead of endlessly retrying. Also refresh the KB detail to get the current state. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
42bf5ad003
commit
3aa99144d4
1 changed files with 5 additions and 0 deletions
|
|
@ -128,6 +128,11 @@ export const KnowledgeBase: React.FC = () => {
|
|||
}
|
||||
} catch (err) {
|
||||
console.error('Failed to poll job:', err);
|
||||
// Stop polling on error (e.g. 404 job not found)
|
||||
setActiveJob(null);
|
||||
if (pollRef.current) clearInterval(pollRef.current);
|
||||
pollRef.current = null;
|
||||
loadKbDetail(selectedKb.id);
|
||||
}
|
||||
}, 3000);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue