Build Agentic workflows, RAG pipelines, with rich AI model and tool support on one collaborative workspace. Deploy on cloud, VPC, or self-hosted, so teams move from prototype to production without rebuilding the stack.
Python agentagentic-aiagentic-frameworkagentic-workflowaiautomationclaudedeepseekgenaigptllmlow-codemcpnextjsno-codeopenaipythonskillsworkflow
fix: status query not stop when leaving document embedding detail page (#4754)
doufab1c9671a60f4
diff --git a/web/app/components/datasets/documents/detail/embedding/index.tsx b/web/app/components/datasets/documents/detail/embedding/index.tsxindex bb844e35a48..48e97f0d59e 100644--- a/web/app/components/datasets/documents/detail/embedding/index.tsx+++ b/web/app/components/datasets/documents/detail/embedding/index.tsx@@ -126,17 +126,13 @@ const EmbeddingDetail: FC<Props> = ({ detail, stopPosition = 'top', datasetId: dreturn status}- const [isStopQuery, setIsStopQuery] = useState(false)- const isStopQueryRef = useRef(isStopQuery)- useEffect(() => {- isStopQueryRef.current = isStopQuery- }, [isStopQuery])- const stopQueryStatus = () => {- setIsStopQuery(true)- }+ const isStopQuery = useRef(false)+ const stopQueryStatus = useCallback(() => {+ isStopQuery.current = true+ }, [])- const startQueryStatus = async () => {- if (isStopQueryRef.current)+ const startQueryStatus = useCallback(async () => {+ if (isStopQuery.current)returntry {@@ -146,6 +142,7 @@ const EmbeddingDetail: FC<Props> = ({ detail, stopPosition = 'top', datasetId: ddetailUpdate()return}+await sleep(2500)await startQueryStatus()}@@ -153,16 +150,15 @@ const EmbeddingDetail: FC<Props> = ({ detail, stopPosition = 'top', datasetId: dawait sleep(2500)await startQueryStatus()}- }+ }, [stopQueryStatus])useEffect(() => {- setIsStopQuery(false)+ isStopQuery.current = falsestartQueryStatus()return () => {stopQueryStatus()}- // eslint-disable-next-line react-hooks/exhaustive-deps- }, [])+ }, [startQueryStatus, stopQueryStatus])const { data: indexingEstimateDetail, error: indexingEstimateErr } = useSWR({action: 'fetchIndexingEstimate',