fix bug
This commit is contained in:
parent
897369d300
commit
dad5d76664
@ -1,9 +1,8 @@
|
|||||||
import threading
|
|
||||||
from typing import Any, Self, List
|
from typing import Any, Self, List
|
||||||
|
|
||||||
from sqlalchemy.orm import as_declarative, declared_attr, Session
|
from sqlalchemy.orm import as_declarative, declared_attr, Session
|
||||||
|
|
||||||
from app.db import ScopedSession, DBLock
|
from app.db import DBLock
|
||||||
|
|
||||||
|
|
||||||
def db_persist(func):
|
def db_persist(func):
|
||||||
@ -20,9 +19,6 @@ def db_persist(func):
|
|||||||
db = arg
|
db = arg
|
||||||
break
|
break
|
||||||
try:
|
try:
|
||||||
if db:
|
|
||||||
db.close()
|
|
||||||
db = ScopedSession()
|
|
||||||
result = func(*args, **kwargs)
|
result = func(*args, **kwargs)
|
||||||
db.commit()
|
db.commit()
|
||||||
except Exception as err:
|
except Exception as err:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user