dify
dify copied to clipboard
The event-status API is being called frantically in document detail page while the document status is Indexing
Self Checks
- [X] This is only for bug report, if you would like to ask a quesion, please head to Discussions.
- [X] I have searched for existing issues search for existing issues, including closed ones.
- [X] I confirm that I am using English to submit this report (我已阅读并同意 Language Policy).
- [X] Pleas do not modify this template :) and fill in all the required fields.
Dify version
0.6.1
Cloud or Self Hosted
Self Hosted (Source)
Steps to reproduce
- create knowleage
- upload a pdf 薛兆丰经济学讲义xg.pdf
- go to the document detail page and wait for a while
✔️ Expected Behavior
The event-status API is called every few seconds.
❌ Actual Behavior
The event-status API is being called frantically
Hey @liuzhenghua! Great to see you diving into another challenge with Dify. Hope all’s been well on your end!
To address the issue of the event-status API being called excessively on the document detail page during the indexing process, it's important to focus on a few potential areas:
-
Frontend Interaction: The behavior you're observing might be related to how the frontend is programmed to poll the event-status API. If it's set to poll too frequently or doesn't properly handle different document statuses, it could lead to the excessive calls you're seeing. Investigating the frontend code for the logic related to polling and handling of document statuses could provide insights.
-
API Call Optimization and Error Handling: On the backend, ensuring that the logic for triggering the
recover_document_indexing_task
and its interaction with the event-status API is optimized can help reduce unnecessary calls. Additionally, improving error handling and logging, especially in areas where exceptions are caught but not specifically handled, might reveal underlying issues contributing to the problem. -
Document Status Checks: Review the conditions under which the event-status API is called, especially in relation to document indexing statuses. Ensuring that these conditions are optimized to avoid unnecessary API calls can help mitigate the issue.
Without more detailed information on the implementation of the event-status API and its interaction with both the frontend and the recover_document_indexing_task
, it's challenging to provide a more specific solution. If you could share more details about how the event-status API is implemented and any customizations made to the Dify codebase, it would be easier to pinpoint the cause and suggest a more targeted solution.
Sources
About Dosu
This response is meant to be useful and save you time. It is not meant to be a precise solution, but rather a starting point for your own research.
Help me be more useful! Please leave a 👍 if this is helpful and 👎 if it is irrelevant.
If you want to continue the conversation, start your reply with @dosu-bot.
Please upgrade to latest version to see if this issue persists. :)