-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Let Vespa have its own worker and queue.
Every search database behaves a bit differently. Vespa takes quite long to index documents (as those indexes are directly available). So we make sure here that each full text search database can be decide for itself that if it need some background task for indexing or do it directly in the request itself.
- Loading branch information
Showing
9 changed files
with
99 additions
and
66 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
from celery import shared_task | ||
|
||
from radis.vespa.utils.document_utils import create_documents, delete_documents, update_documents | ||
|
||
|
||
@shared_task(queue="vespa_queue") | ||
def process_created_reports(report_ids: list[int]) -> None: | ||
create_documents(report_ids) | ||
|
||
|
||
@shared_task(queue="vespa_queue") | ||
def process_updated_reports(report_ids: list[int]) -> None: | ||
update_documents(report_ids) | ||
|
||
|
||
@shared_task(queue="vespa_queue") | ||
def process_deleted_reports(document_ids: list[str]) -> None: | ||
delete_documents(document_ids) |