Skip to content

Commit 8d66b07

Browse files
async search index: run async (#14639)
1 parent e8100cb commit 8d66b07

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

dojo/middleware.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -326,6 +326,7 @@ def _trigger_async_index_update(self, model_groups):
326326
# Import here to avoid circular import
327327
from django.conf import settings # noqa: PLC0415 circular import
328328

329+
from dojo.celery_dispatch import dojo_dispatch_task # noqa: PLC0415 circular import
329330
from dojo.tasks import update_watson_search_index_for_model # noqa: PLC0415 circular import
330331

331332
# Create tasks per model type, chunking large lists into configurable batches
@@ -337,4 +338,4 @@ def _trigger_async_index_update(self, model_groups):
337338
# Create tasks for each batch and log each one
338339
for i, batch in enumerate(batches, 1):
339340
logger.debug(f"AsyncSearchContextMiddleware: Triggering batch {i}/{len(batches)} for {model_name}: {len(batch)} instances")
340-
update_watson_search_index_for_model(model_name, batch)
341+
dojo_dispatch_task(update_watson_search_index_for_model, model_name, batch)

0 commit comments

Comments
 (0)