refactor: keep runtime settings below adapters

This commit is contained in:
jxxghp
2026-08-23 01:45:07 +08:00
parent d15c65b108
commit 2c6e8181c2
8 changed files with 47 additions and 39 deletions
+2 -7
View File
@@ -1,10 +1,9 @@
import importlib
import logging
from functools import lru_cache
from typing import List, Optional, Tuple
from app.application.configuration import get_runtime_settings
from app.runtime.log import logger, log_settings
from app.runtime.settings import get_runtime_setting
try:
import moviepilot_rust as _moviepilot_rust
@@ -17,11 +16,7 @@ else:
def _rust_accel_enabled() -> bool:
"""读取 Rust 开关快照,组合根未装配时回退旧 Settings。"""
try:
return bool(get_runtime_settings().get("RUST_ACCEL"))
except RuntimeError:
legacy_settings = importlib.import_module("app.runtime.config").settings
return bool(legacy_settings.RUST_ACCEL)
return bool(get_runtime_setting("RUST_ACCEL"))
def is_available() -> bool: