mirror of
https://gitee.com/dify_ai/dify.git
synced 2024-11-30 02:08:37 +08:00
Fix: stop indexing status check when api of status checking failed (#3156)
This commit is contained in:
parent
16e3b0484d
commit
762657eeef
@ -120,19 +120,19 @@ const EmbeddingDetail: FC<Props> = ({ detail, stopPosition = 'top', datasetId: d
|
||||
const localDocumentId = docId ?? documentId
|
||||
const localIndexingTechnique = indexingType ?? indexingTechnique
|
||||
|
||||
// const { data: indexingStatusDetailFromApi, error: indexingStatusErr, mutate: statusMutate } = useSWR({
|
||||
// action: 'fetchIndexingStatus',
|
||||
// datasetId: localDatasetId,
|
||||
// documentId: localDocumentId,
|
||||
// }, apiParams => fetchIndexingStatus(omit(apiParams, 'action')), {
|
||||
// refreshInterval: 2500,
|
||||
// revalidateOnFocus: false,
|
||||
// })
|
||||
|
||||
const [indexingStatusDetail, setIndexingStatusDetail, getIndexingStatusDetail] = useGetState<any>(null)
|
||||
const fetchIndexingStatus = async () => {
|
||||
const status = await doFetchIndexingStatus({ datasetId: localDatasetId, documentId: localDocumentId })
|
||||
setIndexingStatusDetail(status)
|
||||
try {
|
||||
const status = await doFetchIndexingStatus({ datasetId: localDatasetId, documentId: localDocumentId })
|
||||
setIndexingStatusDetail(status)
|
||||
// eslint-disable-next-line @typescript-eslint/no-use-before-define
|
||||
startQueryStatus()
|
||||
}
|
||||
catch (err) {
|
||||
// eslint-disable-next-line @typescript-eslint/no-use-before-define
|
||||
stopQueryStatus()
|
||||
notify({ type: 'error', message: `error: ${err}` })
|
||||
}
|
||||
}
|
||||
|
||||
const [runId, setRunId, getRunId] = useGetState<any>(null)
|
||||
@ -156,7 +156,6 @@ const EmbeddingDetail: FC<Props> = ({ detail, stopPosition = 'top', datasetId: d
|
||||
|
||||
useEffect(() => {
|
||||
fetchIndexingStatus()
|
||||
startQueryStatus()
|
||||
return () => {
|
||||
stopQueryStatus()
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user