From eb37ed4c74ac2d41ae9fe3a16f328edd35408a65 Mon Sep 17 00:00:00 2001 From: 3252a8 <3252a8@proton.me> Date: Sun, 17 May 2026 10:03:05 +0300 Subject: [PATCH] refactor: stop swallowing critical service wiring failures --- backend/bot/app/factories/build_services.py | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/backend/bot/app/factories/build_services.py b/backend/bot/app/factories/build_services.py index ed9363e..6d7f4a3 100644 --- a/backend/bot/app/factories/build_services.py +++ b/backend/bot/app/factories/build_services.py @@ -81,14 +81,12 @@ def build_core_services( api_url=settings.LKNPD_API_URL, ) - # Wire services that depend on each other - try: - # Attach YooKassa to subscription service for auto-renew charges - setattr(subscription_service, "yookassa_service", yookassa_service) - # Allow panel webhook to trigger renewals through subscription service - setattr(panel_webhook_service, "subscription_service", subscription_service) - except Exception: - pass + # Wire services that depend on each other. These attachments are critical + # for auto-renew (subscription_service.yookassa_service) and for the panel + # webhook handler's 24h pre-expiry renewal trigger; do NOT swallow errors — + # silent wiring failures previously caused auto-renew to disappear. + subscription_service.yookassa_service = yookassa_service + panel_webhook_service.subscription_service = subscription_service return { "panel_service": panel_service,