mirror of
https://github.com/BEDOLAGA-DEV/remnawave-bedolaga-telegram-bot.git
synced 2026-02-22 12:21:26 +00:00
fix: sync SUPPORT_SYSTEM_MODE between SystemSettings and SupportSettings
When changing SUPPORT_SYSTEM_MODE via system settings admin panel, the SupportSettingsService JSON cache was not updated, causing the old value to take priority. Now both services stay in sync bidirectionally.
This commit is contained in:
@@ -62,6 +62,7 @@ class SupportSettingsService:
|
||||
return False
|
||||
cls._load()
|
||||
cls._data['system_mode'] = mode_clean
|
||||
settings.SUPPORT_SYSTEM_MODE = mode_clean
|
||||
return cls._save()
|
||||
|
||||
# Main menu visibility
|
||||
|
||||
@@ -1603,6 +1603,13 @@ class BotConfigurationService:
|
||||
)
|
||||
except Exception as error:
|
||||
logger.error('Не удалось обновить сервис автосинхронизации RemnaWave', error=error)
|
||||
elif key == 'SUPPORT_SYSTEM_MODE':
|
||||
try:
|
||||
from app.services.support_settings_service import SupportSettingsService
|
||||
|
||||
SupportSettingsService.set_system_mode(str(value))
|
||||
except Exception as error:
|
||||
logger.error('Не удалось синхронизировать SupportSettingsService', error=error)
|
||||
elif key in {
|
||||
'REMNAWAVE_API_URL',
|
||||
'REMNAWAVE_API_KEY',
|
||||
|
||||
Reference in New Issue
Block a user