fix db session

This commit is contained in:
jxxghp
2023-10-18 18:30:09 +08:00
parent 68e16d18fe
commit 2e4536edb6
10 changed files with 48 additions and 48 deletions

View File

@ -2,7 +2,7 @@ import time
from typing import Tuple, List
from app.core.context import MediaInfo
from app.db import DbOper, db_lock
from app.db import DbOper
from app.db.models.subscribe import Subscribe
@ -11,7 +11,6 @@ class SubscribeOper(DbOper):
订阅管理
"""
@db_lock
def add(self, mediainfo: MediaInfo, **kwargs) -> Tuple[int, str]:
"""
新增订阅
@ -58,14 +57,12 @@ class SubscribeOper(DbOper):
return Subscribe.get_by_state(self._db, state)
return Subscribe.list(self._db)
@db_lock
def delete(self, sid: int):
"""
删除订阅
"""
Subscribe.delete(self._db, rid=sid)
@db_lock
def update(self, sid: int, payload: dict) -> Subscribe:
"""
更新订阅