fix 数据库会话管理

This commit is contained in:
jxxghp
2023-08-16 10:22:45 +08:00
parent b086bbf015
commit da93328d50
29 changed files with 255 additions and 172 deletions

View File

@ -7,6 +7,7 @@ from typing import Optional, Any, Tuple, List, Set, Union, Dict
from qbittorrentapi import TorrentFilesList
from ruamel.yaml import CommentedMap
from sqlalchemy.orm import Session
from transmission_rpc import File
from app.core.config import settings
@ -27,10 +28,11 @@ class ChainBase(metaclass=ABCMeta):
处理链基类
"""
def __init__(self):
def __init__(self, db: Session = None):
"""
公共初始化
"""
self._db = db
self.modulemanager = ModuleManager()
self.eventmanager = EventManager()