-
Notifications
You must be signed in to change notification settings - Fork 5
Performance Improvments #148
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: dev/1.1.x
Are you sure you want to change the base?
Conversation
|
To test, add |
apeters
left a comment
There was a problem hiding this 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...
| if ( | ||
| hasattr(settings, "EVENTUALLY_CONSISTENT_ES_INDEXING") | ||
| and settings.EVENTUALLY_CONSISTENT_ES_INDEXING | ||
| and task_management.check_if_celery_available() | ||
| ): |
There was a problem hiding this comment.
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
| 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() | |
| ): |
arches_querysets/tasks.py
Outdated
| 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() |
There was a problem hiding this comment.
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
| 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}") | |
3d1320a to
f00b962
Compare
Adds specificity to after_update_all for geojson geometries and eventually consistent indexing - the index call is no longer blocking when enabled.