From 8eda9f04d44d6cee1478f67be2a2e096c23ae959 Mon Sep 17 00:00:00 2001 From: PSNAppZ Date: Wed, 18 Sep 2024 11:12:07 +0530 Subject: [PATCH] Invoke account_statement_generator task after the payments are processed --- .../tasks/process_payment.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/openg2p-g2p-bridge-example-bank-celery/src/openg2p_g2p_bridge_example_bank_celery/tasks/process_payment.py b/openg2p-g2p-bridge-example-bank-celery/src/openg2p_g2p_bridge_example_bank_celery/tasks/process_payment.py index bc8abe3..d260e0f 100644 --- a/openg2p-g2p-bridge-example-bank-celery/src/openg2p_g2p_bridge_example_bank_celery/tasks/process_payment.py +++ b/openg2p-g2p-bridge-example-bank-celery/src/openg2p_g2p_bridge_example_bank_celery/tasks/process_payment.py @@ -146,6 +146,11 @@ def process_payments_worker(payment_request_batch_id: str): ) session.add(account_statement) session.commit() + _logger.info("Account statement generation task created") + celery_app.send_task( + "account_statement_generator", + args=(account_statement.id,), + ) except Exception as e: _logger.error(f"Error processing payment: {e}") session.rollback()