From 89f626bd5e17c9aa87a245954b01c3f275f03f32 Mon Sep 17 00:00:00 2001 From: Jay Varner Date: Fri, 12 Jan 2024 14:23:42 -0500 Subject: [PATCH] Rename task for clarity --- readux_ingest_ecds/admin.py | 6 +++--- readux_ingest_ecds/tasks.py | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/readux_ingest_ecds/admin.py b/readux_ingest_ecds/admin.py index c19bab2..b6b90a7 100644 --- a/readux_ingest_ecds/admin.py +++ b/readux_ingest_ecds/admin.py @@ -6,7 +6,7 @@ from django.shortcuts import redirect from django_celery_results.models import TaskResult from .models import Local -from .tasks import local_ingest_task +from .tasks import local_ingest_task_ecds LOGGER = logging.getLogger(__name__) @@ -21,9 +21,9 @@ def save_model(self, request, obj, form, change): obj.process() super().save_model(request, obj, form, change) if os.environ["DJANGO_ENV"] != 'test': # pragma: no cover - local_ingest_task.apply_async(args=[obj.id]) + local_ingest_task_ecds.apply_async(args=[obj.id]) else: - local_ingest_task(obj.id) + local_ingest_task_ecds(obj.id) def response_add(self, request, obj, post_url_continue=None): obj.refresh_from_db() diff --git a/readux_ingest_ecds/tasks.py b/readux_ingest_ecds/tasks.py index 04916fc..43e194b 100644 --- a/readux_ingest_ecds/tasks.py +++ b/readux_ingest_ecds/tasks.py @@ -19,8 +19,8 @@ app.config_from_object('django.conf:settings') app.autodiscover_tasks(lambda: settings.INSTALLED_APPS) -@app.task(name='local_ingest_task', autoretry_for=(Exception,), retry_backoff=True, max_retries=20) -def local_ingest_task(ingest_id): +@app.task(name='local_ingest_task_ecds', autoretry_for=(Exception,), retry_backoff=True, max_retries=20) +def local_ingest_task_ecds(ingest_id): """Background task to start ingest process. :param ingest_id: Primary key for .models.Local object