refactor:重构配置热加载

This commit is contained in:
jxxghp
2025-06-03 20:56:21 +08:00
parent 5f18a21e86
commit b4ed2880f7
18 changed files with 291 additions and 80 deletions

View File

@@ -5,18 +5,19 @@ from qbittorrentapi import TorrentFilesList
from torrentool.torrent import Torrent
from app import schemas
from app.core.config import settings
from app.core.config import settings, on_config_change
from app.core.metainfo import MetaInfo
from app.log import logger
from app.modules import _ModuleBase, _DownloaderBase
from app.modules.qbittorrent.qbittorrent import Qbittorrent
from app.schemas import TransferTorrent, DownloadingTorrent
from app.schemas.types import TorrentStatus, ModuleType, DownloaderType
from app.schemas.types import TorrentStatus, ModuleType, DownloaderType, SystemConfigKey
from app.utils.string import StringUtils
class QbittorrentModule(_ModuleBase, _DownloaderBase[Qbittorrent]):
@on_config_change([SystemConfigKey.Downloaders.value])
def init_module(self) -> None:
"""
初始化模块