mirror of
https://github.com/jxxghp/MoviePilot.git
synced 2026-09-05 23:47:41 +08:00
refactor: finish startup settings migration
This commit is contained in:
@@ -12,7 +12,9 @@ from app.agent.runtime_loader import (
|
||||
from app.agent.llm.gateway import register_llm_provider_runtime
|
||||
from app.application.agent import register_agent_service_providers
|
||||
from app.application.messaging.skill import register_skill_catalog_provider
|
||||
from app.runtime.config import settings
|
||||
from app.runtime.settings import RuntimeSettingsCompat
|
||||
|
||||
settings = RuntimeSettingsCompat()
|
||||
from app.runtime.events import Event, eventmanager
|
||||
from app.runtime.log import logger
|
||||
from app.schemas.types import EventType
|
||||
|
||||
@@ -20,7 +20,9 @@ from app.db.engine import get_engine
|
||||
from app.db.health import probe_database
|
||||
from app.db.maintenance import DatabaseCleanupRepository
|
||||
from app.db.session import SessionFactory
|
||||
from app.runtime.config import settings
|
||||
from app.runtime.settings import RuntimeSettingsCompat
|
||||
|
||||
settings = RuntimeSettingsCompat()
|
||||
|
||||
|
||||
def build_database_governance() -> DatabaseGovernance:
|
||||
|
||||
@@ -10,7 +10,9 @@ from alembic.util import CommandError
|
||||
from sqlalchemy import inspect
|
||||
from sqlalchemy.engine import Engine
|
||||
|
||||
from app.runtime.config import settings
|
||||
from app.runtime.settings import RuntimeSettingsCompat
|
||||
|
||||
settings = RuntimeSettingsCompat()
|
||||
from app.db.base import Base
|
||||
from app.db.engine import get_engine
|
||||
from app.db.models import load_all_models
|
||||
|
||||
@@ -6,7 +6,9 @@ from app.domain.meta.runtime import configure_recognition_runtime
|
||||
from app.domain.meta.words import configure_custom_words_provider
|
||||
from app.domain.metainfo import clear_rust_parse_options_cache
|
||||
from app.adapters.system import rust as rust_accelerator
|
||||
from app.runtime.config import settings
|
||||
from app.runtime.settings import RuntimeSettingsCompat
|
||||
|
||||
settings = RuntimeSettingsCompat()
|
||||
from app.application.recognition import RecognitionRuleService
|
||||
|
||||
|
||||
|
||||
@@ -26,7 +26,10 @@ except Exception:
|
||||
|
||||
from app.chain.system import SystemChain
|
||||
from app.application.plugin.runtime import get_plugin_manager
|
||||
from app.runtime.config import global_vars, settings
|
||||
from app.runtime.config import global_vars
|
||||
from app.runtime.settings import RuntimeSettingsCompat
|
||||
|
||||
settings = RuntimeSettingsCompat()
|
||||
from app.runtime.health import get_application_health
|
||||
from app.runtime.topology import validate_process_topology
|
||||
from app.adapters.external.server import MoviePilotServerHelper
|
||||
|
||||
@@ -17,7 +17,10 @@ except ImportError as e:
|
||||
|
||||
from app.adapters.system.host import SystemUtils
|
||||
from app.runtime.log import logger
|
||||
from app.runtime.config import settings
|
||||
from app.runtime.settings import RuntimeSettingsCompat
|
||||
from app.runtime.config import settings as legacy_settings
|
||||
|
||||
settings = RuntimeSettingsCompat()
|
||||
from app.runtime.cache import AsyncFileCache, FileCache
|
||||
from app.runtime.extensions.module_manager import ModuleManager
|
||||
from app.runtime.extensions.module.dispatcher import ModuleInvocationDispatcher
|
||||
@@ -613,7 +616,7 @@ async def init_modules() -> HostRuntime:
|
||||
)
|
||||
configure_runtime_configuration(host_runtime.configuration)
|
||||
configure_runtime_settings(host_runtime.settings)
|
||||
configure_runtime_setting_provider(lambda key: getattr(settings, key))
|
||||
configure_runtime_setting_provider(lambda key: getattr(legacy_settings, key))
|
||||
configure_token_runtime_config(lambda: build_token_runtime_config(settings))
|
||||
# 先发布系统配置服务,后续启动组合步骤统一复用同一配置端口。
|
||||
configure_system_config(SystemConfigService(repository=SystemConfigOper()))
|
||||
|
||||
@@ -7,7 +7,9 @@ from app.runtime.compat.diagnostics import (
|
||||
from app.runtime.compat.resource_imports import scan_plugin_resource_imports
|
||||
from app.application.plugin.routes import register_plugin_api
|
||||
from app.runtime.config import global_vars
|
||||
from app.runtime.config import settings
|
||||
from app.runtime.settings import RuntimeSettingsCompat
|
||||
|
||||
settings = RuntimeSettingsCompat()
|
||||
from app.runtime.extensions.plugin_manager import (
|
||||
PluginManager,
|
||||
configure_plugin_catalog_factory,
|
||||
|
||||
Reference in New Issue
Block a user