fix db session

This commit is contained in:
jxxghp
2023-09-09 19:26:56 +08:00
parent ccc249f29d
commit 0e36d003c0
16 changed files with 39 additions and 49 deletions

View File

@ -12,7 +12,7 @@ from app.chain.rss import RssChain
from app.chain.subscribe import SubscribeChain
from app.chain.transfer import TransferChain
from app.core.config import settings
from app.db import ScopedSession
from app.db import SessionFactory
from app.log import logger
from app.utils.singleton import Singleton
from app.utils.timer import TimerUtils
@ -40,7 +40,7 @@ class Scheduler(metaclass=Singleton):
def __init__(self):
# 数据库连接
self._db = ScopedSession()
self._db = SessionFactory()
# 调试模式不启动定时服务
if settings.DEV:
return