diff --git a/surfsense_backend/app/services/task_dispatcher.py b/surfsense_backend/app/services/task_dispatcher.py index e45d601a6..9a6fc7d63 100644 --- a/surfsense_backend/app/services/task_dispatcher.py +++ b/surfsense_backend/app/services/task_dispatcher.py @@ -18,6 +18,7 @@ class TaskDispatcher(Protocol): filename: str, search_space_id: int, user_id: str, + should_summarize: bool = False, ) -> None: ... @@ -32,6 +33,7 @@ class CeleryTaskDispatcher: filename: str, search_space_id: int, user_id: str, + should_summarize: bool = False, ) -> None: from app.tasks.celery_tasks.document_tasks import ( process_file_upload_with_document_task, @@ -43,6 +45,7 @@ class CeleryTaskDispatcher: filename=filename, search_space_id=search_space_id, user_id=user_id, + should_summarize=should_summarize, ) diff --git a/surfsense_backend/tests/conftest.py b/surfsense_backend/tests/conftest.py index e1f0bc178..e2b586aa2 100644 --- a/surfsense_backend/tests/conftest.py +++ b/surfsense_backend/tests/conftest.py @@ -13,10 +13,10 @@ TEST_DATABASE_URL = os.environ.get("TEST_DATABASE_URL", _DEFAULT_TEST_DB) # DATABASE_URL in the environment (e.g. from .env or shell profile). os.environ["DATABASE_URL"] = TEST_DATABASE_URL -import pytest +import pytest # noqa: E402 -from app.db import DocumentType -from app.indexing_pipeline.connector_document import ConnectorDocument +from app.db import DocumentType # noqa: E402 +from app.indexing_pipeline.connector_document import ConnectorDocument # noqa: E402 # --------------------------------------------------------------------------- # Unit test fixtures diff --git a/surfsense_backend/tests/integration/document_upload/conftest.py b/surfsense_backend/tests/integration/document_upload/conftest.py index 78dcf1db9..6daa171d6 100644 --- a/surfsense_backend/tests/integration/document_upload/conftest.py +++ b/surfsense_backend/tests/integration/document_upload/conftest.py @@ -64,6 +64,7 @@ class InlineTaskDispatcher: filename: str, search_space_id: int, user_id: str, + should_summarize: bool = False, ) -> None: from app.tasks.celery_tasks.document_tasks import ( _process_file_with_document, @@ -71,7 +72,12 @@ class InlineTaskDispatcher: with contextlib.suppress(Exception): await _process_file_with_document( - document_id, temp_path, filename, search_space_id, user_id + document_id, + temp_path, + filename, + search_space_id, + user_id, + should_summarize=should_summarize, )