Skip to content

Commit

Permalink
Rename task for clarity
Browse files Browse the repository at this point in the history
  • Loading branch information
jayvarner committed Jan 12, 2024
1 parent 513e495 commit 89f626b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions readux_ingest_ecds/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -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__)

Expand All @@ -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()
Expand Down
4 changes: 2 additions & 2 deletions readux_ingest_ecds/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 89f626b

Please sign in to comment.