fix: apply persisted provider overrides on startup

This commit is contained in:
3252a8
2026-05-18 21:40:45 +03:00
parent fcd494f815
commit d870915dc0
6 changed files with 27 additions and 7 deletions
@@ -196,7 +196,17 @@ def write_appearance_backup(settings: Settings) -> None:
async def load_overrides_from_db(settings: Settings, async_session_factory: sessionmaker) -> int:
"""Fetch overrides from the DB and apply them to the in-memory settings."""
"""Fetch overrides from the DB and apply them to the in-memory settings.
Provider env-configs live on per-provider BaseSettings bundles instead of
the central Settings model. Apply needs those bundles to already exist,
otherwise provider-owned overrides (e.g. ``HELEKET_ENABLED``) silently
drop on the floor. Build them up-front; the call is idempotent so the
later ``build_core_services`` invocation reuses these same instances.
"""
from bot.payment_providers import build_provider_configs
build_provider_configs()
try:
async with async_session_factory() as session: