diff --git a/readux_ingest_ecds/tasks.py b/readux_ingest_ecds/tasks.py index d25f0a3..32205a6 100644 --- a/readux_ingest_ecds/tasks.py +++ b/readux_ingest_ecds/tasks.py @@ -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, @@ -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() diff --git a/test_app/tests/test_s3.py b/test_app/tests/test_s3.py index 3f3957b..cee0b36 100644 --- a/test_app/tests/test_s3.py +++ b/test_app/tests/test_s3.py @@ -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 @@ -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: @@ -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: