Skip to content

Conversation

@aarongundel
Copy link
Contributor

Adds specificity to after_update_all for geojson geometries and eventually consistent indexing - the index call is no longer blocking when enabled.

@aarongundel
Copy link
Contributor Author

To test, add
CELERY_CHECK_ONLY_INSPECT_BROKER = True
EVENTUALLY_CONSISTENT_ES_INDEXING = True

Copy link
Member

@apeters apeters left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

overall looks good. Just a couple of nits...

Comment on lines 254 to 257
if (
hasattr(settings, "EVENTUALLY_CONSISTENT_ES_INDEXING")
and settings.EVENTUALLY_CONSISTENT_ES_INDEXING
and task_management.check_if_celery_available()
):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just a wee bit cleaner

Suggested change
if (
hasattr(settings, "EVENTUALLY_CONSISTENT_ES_INDEXING")
and settings.EVENTUALLY_CONSISTENT_ES_INDEXING
and task_management.check_if_celery_available()
):
if (
getattr(settings, "EVENTUALLY_CONSISTENT_ES_INDEXING", False)
and task_management.check_if_celery_available()
):

Comment on lines 1 to 12
from arches.app.models.resource import Resource
from celery import shared_task


@shared_task
def index_resource(resource_id):
proxy_resource = (
Resource.objects.filter(pk=resource_id)
# .select_related("graph__publication")
.get()
)
proxy_resource.index()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe we should add a little error trapping here

Suggested change
from arches.app.models.resource import Resource
from celery import shared_task
@shared_task
def index_resource(resource_id):
proxy_resource = (
Resource.objects.filter(pk=resource_id)
# .select_related("graph__publication")
.get()
)
proxy_resource.index()
import logging
from arches.app.models.resource import Resource
from celery import shared_task
@shared_task
def index_resource(resource_id):
logger = logging.getLogger(__name__)
try:
proxy_resource = (
Resource.objects.get(pk=resource_id)
)
proxy_resource.index()
except Resource.DoesNotExist:
logger.error(f"Resource with id {resource_id} does not exist.")
except Exception as e:
logger.error(f"Error indexing resource {resource_id}: {e}")

@aarongundel aarongundel force-pushed the adg/performance-improvements branch from 3d1320a to f00b962 Compare December 23, 2025 21:32
@aarongundel aarongundel requested a review from apeters December 23, 2025 21:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants