diff --git a/app.py b/app.py index 23c7d2b..51efc32 100644 --- a/app.py +++ b/app.py @@ -1,6 +1,4 @@ from app import create_app -from app.integrations import KafkaIntegration -from app.config import settings app = create_app() diff --git a/app/config.py b/app/config.py index a56a39a..c6ed9bc 100644 --- a/app/config.py +++ b/app/config.py @@ -11,6 +11,7 @@ class Config: KAFKA_BROKER = "dev-events.simbrellang.net:9084" KAFKA_PAYMENT_TOPIC = "PROCESS_PAYMENT" + KAFKA_TIMEOUT = 5.0 settings = Config() diff --git a/wsgi.py b/wsgi.py index 697264b..7137082 100644 --- a/wsgi.py +++ b/wsgi.py @@ -12,7 +12,7 @@ if __name__ != "__main__": while True: message = kafka.receive_disbursement_messages( - topic=settings.KAFKA_PAYMENT_TOPIC, timeout=1.0 + topic=settings.KAFKA_PAYMENT_TOPIC, timeout=settings.KAFKA_TIMEOUT ) if message: @@ -20,19 +20,5 @@ if __name__ != "__main__": else: logger.info("No message received within timeout") - # try: - # message = kafka.receive_disbursement_messages( - # topic=settings.KAFKA_PAYMENT_TOPIC, timeout=5.0 - # ) - - # if message: - # logger.info(f"Processed message: {message}") - # else: - # logger.info("No message received within timeout") - # except Exception as e: - # print(f"Error: {e}") - # finally: - # kafka.close_consumer() - # Expose WSGI app instance for Gunicorn wsgi_app = app