Skip to content

Commit f695018

Browse files
authored
Merge pull request #700 from apecloud/add_rerun_buttom_for_doc_indexing
feat: add rerun button for doc indexing
2 parents f87a0c9 + a87a7f4 commit f695018

File tree

3 files changed

+315
-39
lines changed

3 files changed

+315
-39
lines changed

aperag/tasks/index.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,7 @@ def update_index_for_document(self, document_id):
300300
document.save()
301301

302302
try:
303-
relate_ids = json.loads(document.relate_ids)
303+
relate_ids = json.loads(document.relate_ids) if document.relate_ids.strip() else {}
304304
source = get_source(json.loads(document.collection.config))
305305
metadata = json.loads(document.metadata)
306306
local_doc = source.prepare_document(name=document.name, metadata=metadata)

aperag/views/main.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -689,7 +689,7 @@ async def update_document(
689689
# if user add labels for a document, we need to update index
690690
update_index_for_document.delay(instance.id)
691691

692-
related_questions = await sync_to_async(document.question_set.exclude)(status=QuestionStatus.DELETED)
692+
related_questions = await sync_to_async(instance.question_set.exclude)(status=QuestionStatus.DELETED)
693693
async for question in related_questions:
694694
question.status = QuestionStatus.WARNING
695695
await question.asave()

0 commit comments

Comments
 (0)