fix db session

This commit is contained in:
jxxghp
2023-10-18 08:35:16 +08:00
parent 84f5ce8a0b
commit fb78a07662
49 changed files with 170 additions and 224 deletions

View File

@ -57,7 +57,7 @@ class DownloadingMsg(_PluginBase):
# 加载模块
if self._enabled:
self._downloadhis = DownloadHistoryOper(self.db)
self._downloadhis = DownloadHistoryOper()
# 定时服务
self._scheduler = BackgroundScheduler(timezone=settings.TZ)
@ -80,7 +80,7 @@ class DownloadingMsg(_PluginBase):
定时推送正在下载进度
"""
# 正在下载种子
torrents = DownloadChain(self.db).list_torrents(status=TorrentStatus.DOWNLOADING)
torrents = DownloadChain().list_torrents(status=TorrentStatus.DOWNLOADING)
if not torrents:
logger.info("当前没有正在下载的任务!")
return