Skip to content

Commit

Permalink
Make task names consistent
Browse files Browse the repository at this point in the history
  • Loading branch information
jayvarner committed Aug 12, 2024
1 parent cbdd39a commit 987fea6
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
8 changes: 6 additions & 2 deletions readux_ingest_ecds/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ def bulk_ingest_task_ecds(ingest_id):


@app.task(
name="ingest_ocr_to_canvas",
name="add_ocr_task_local_ecds",
base=FinalTask,
autoretry_for=(Manifest.DoesNotExist,),
retry_backoff=5,
Expand All @@ -120,10 +120,14 @@ def add_ocr_task_local(ingest_id, *args, **kwargs):


@app.task(
name="s3_ingest", autoretry_for=(Exception,), retry_backoff=True, max_retries=20
name="s3_ingest_task_ecds",
autoretry_for=(Exception,),
retry_backoff=True,
max_retries=20,
)
def s3_ingest_task(ingest_id, *args, **kwargs):
"""S3 Ingest Task"""
LOGGER.info("Starting ingest from S3")
print(ingest_id)
s3_ingest = S3Ingest.objects.get(pk=ingest_id)
s3_ingest.ingest()
7 changes: 5 additions & 2 deletions test_app/tests/test_s3.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
from django.core.files.uploadedfile import SimpleUploadedFile
from .factories import ImageServerFactory, S3IngestFactory
from iiif.models import Manifest
from readux_ingest_ecds.tasks import s3_ingest_task


@mock_aws
Expand Down Expand Up @@ -105,7 +106,8 @@ def test_s3_ingest_pid_not_in_filename(self):
)

ingest = S3IngestFactory(metadata_spreadsheet=upload_file)
ingest.ingest()
s3_ingest_task(ingest.id)
# ingest.ingest()

destination_bucket = self.s3.Bucket(settings.INGEST_BUCKET)
for pid in pids:
Expand Down Expand Up @@ -133,7 +135,8 @@ def test_s3_ingest_pid_in_filename(self):
)

ingest = S3IngestFactory(metadata_spreadsheet=upload_file)
ingest.ingest()
# ingest.ingest()
s3_ingest_task(ingest.id)

destination_bucket = self.s3.Bucket(settings.INGEST_BUCKET)
for pid in pids:
Expand Down

0 comments on commit 987fea6

Please sign in to comment.