diff --git a/app/celery/scheduled_tasks.py b/app/celery/scheduled_tasks.py index e03545cb8..ab58a3a9f 100644 --- a/app/celery/scheduled_tasks.py +++ b/app/celery/scheduled_tasks.py @@ -267,14 +267,20 @@ def process_delivery_receipts(self): ) print(f"DELIVERED {delivered_receipts} FAILED {failed_receipts}") delivered_receipts = list(delivered_receipts) + print(f"DELIVERED LIST {delivered_receipts}") for i in range(0, len(delivered_receipts), batch_size): batch = delivered_receipts[i : i + batch_size] + print("UPDATING DELIVERY RECEIPTS") dao_update_delivery_receipts(batch, True) + print("DEIVERY RECEIPTS UPDATED") failed_receipts = list(failed_receipts) for i in range(0, len(failed_receipts), batch_size): + print("UDPATING FAILED RECEIPTS") batch = failed_receipts[i : i + batch_size] dao_update_delivery_receipts(batch, False) + print("FAILED RECEITPS UPDATED") except Exception as ex: + print(f"EXCEPTION {ex}") retry_count = self.request.retries wait_time = 3600 * 2**retry_count try: diff --git a/tests/app/celery/test_scheduled_tasks.py b/tests/app/celery/test_scheduled_tasks.py index e2ed00963..8e3160ea4 100644 --- a/tests/app/celery/test_scheduled_tasks.py +++ b/tests/app/celery/test_scheduled_tasks.py @@ -618,9 +618,6 @@ def test_process_delivery_receipts_success(mocker): processor.retry = MagicMock() processor.process_delivery_receipts() - - cloudwatch_mock.check_delivery_receipts.assert_called_once() - assert dao_update_mock.call_count == 3 dao_update_mock.assert_any_call(list(range(1000)), True) dao_update_mock.assert_any_call(list(range(1000, 2000)), True)