refactor: stop swallowing critical service wiring failures

This commit is contained in:
3252a8
2026-05-17 10:03:05 +03:00
parent 6800734136
commit eb37ed4c74
+6 -8
View File
@@ -81,14 +81,12 @@ def build_core_services(
api_url=settings.LKNPD_API_URL, api_url=settings.LKNPD_API_URL,
) )
# Wire services that depend on each other # Wire services that depend on each other. These attachments are critical
try: # for auto-renew (subscription_service.yookassa_service) and for the panel
# Attach YooKassa to subscription service for auto-renew charges # webhook handler's 24h pre-expiry renewal trigger; do NOT swallow errors —
setattr(subscription_service, "yookassa_service", yookassa_service) # silent wiring failures previously caused auto-renew to disappear.
# Allow panel webhook to trigger renewals through subscription service subscription_service.yookassa_service = yookassa_service
setattr(panel_webhook_service, "subscription_service", subscription_service) panel_webhook_service.subscription_service = subscription_service
except Exception:
pass
return { return {
"panel_service": panel_service, "panel_service": panel_service,