Commit 779312a3 authored by jyong's avatar jyong

add notion page icon to document

parent 26ad00ff
...@@ -264,7 +264,7 @@ class DataSourceNotionDatasetSyncApi(Resource): ...@@ -264,7 +264,7 @@ class DataSourceNotionDatasetSyncApi(Resource):
documents = DocumentService.get_document_by_dataset_id(dataset_id_str) documents = DocumentService.get_document_by_dataset_id(dataset_id_str)
for document in documents: for document in documents:
document_indexing_sync_task.delay(dataset_id, document.id) document_indexing_sync_task.delay(dataset_id_str, document.id)
return 200 return 200
...@@ -283,7 +283,7 @@ class DataSourceNotionDocumentSyncApi(Resource): ...@@ -283,7 +283,7 @@ class DataSourceNotionDocumentSyncApi(Resource):
document = DocumentService.get_document(dataset_id_str, document_id_str) document = DocumentService.get_document(dataset_id_str, document_id_str)
if document is None: if document is None:
raise NotFound("Document not found.") raise NotFound("Document not found.")
document_indexing_sync_task.delay(dataset_id, document.id) document_indexing_sync_task.delay(dataset_id_str, document_id_str)
return 200 return 200
......
...@@ -91,7 +91,7 @@ def document_indexing_sync_task(dataset_id: str, document_id: str): ...@@ -91,7 +91,7 @@ def document_indexing_sync_task(dataset_id: str, document_id: str):
logging.exception("Cleaned document when document update data source or process rule failed") logging.exception("Cleaned document when document update data source or process rule failed")
try: try:
indexing_runner = IndexingRunner() indexing_runner = IndexingRunner()
indexing_runner.run(document) indexing_runner.run(list(document))
end_at = time.perf_counter() end_at = time.perf_counter()
logging.info(click.style('update document: {} latency: {}'.format(document.id, end_at - start_at), fg='green')) logging.info(click.style('update document: {} latency: {}'.format(document.id, end_at - start_at), fg='green'))
except DocumentIsPausedException: except DocumentIsPausedException:
......
...@@ -67,7 +67,7 @@ def document_indexing_update_task(dataset_id: str, document_id: str): ...@@ -67,7 +67,7 @@ def document_indexing_update_task(dataset_id: str, document_id: str):
logging.exception("Cleaned document when document update data source or process rule failed") logging.exception("Cleaned document when document update data source or process rule failed")
try: try:
indexing_runner = IndexingRunner() indexing_runner = IndexingRunner()
indexing_runner.run(document) indexing_runner.run(list(document))
end_at = time.perf_counter() end_at = time.perf_counter()
logging.info(click.style('update document: {} latency: {}'.format(document.id, end_at - start_at), fg='green')) logging.info(click.style('update document: {} latency: {}'.format(document.id, end_at - start_at), fg='green'))
except DocumentIsPausedException: except DocumentIsPausedException:
......
...@@ -34,7 +34,7 @@ def recover_document_indexing_task(dataset_id: str, document_id: str): ...@@ -34,7 +34,7 @@ def recover_document_indexing_task(dataset_id: str, document_id: str):
try: try:
indexing_runner = IndexingRunner() indexing_runner = IndexingRunner()
if document.indexing_status in ["waiting", "parsing", "cleaning"]: if document.indexing_status in ["waiting", "parsing", "cleaning"]:
indexing_runner.run(document) indexing_runner.run(list(document))
elif document.indexing_status == "splitting": elif document.indexing_status == "splitting":
indexing_runner.run_in_splitting_status(document) indexing_runner.run_in_splitting_status(document)
elif document.indexing_status == "indexing": elif document.indexing_status == "indexing":
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment