mirror of
https://github.com/langgenius/dify.git
synced 2026-04-29 20:48:01 +08:00
fix: session of db
This commit is contained in:
parent
65d376bdae
commit
0e1444d17c
@ -1,5 +1,3 @@
|
|||||||
from sqlalchemy.orm import Session
|
|
||||||
|
|
||||||
from configs import dify_config
|
from configs import dify_config
|
||||||
from extensions.ext_database import db
|
from extensions.ext_database import db
|
||||||
from models.model import AccountTrialAppRecord, TrialApp
|
from models.model import AccountTrialAppRecord, TrialApp
|
||||||
@ -62,7 +60,7 @@ class RecommendedAppService:
|
|||||||
:param app_id: app id
|
:param app_id: app id
|
||||||
:return:
|
:return:
|
||||||
"""
|
"""
|
||||||
with Session(db.engine) as session:
|
with db.session as session:
|
||||||
account_trial_app_record = session.query(AccountTrialAppRecord).where(
|
account_trial_app_record = session.query(AccountTrialAppRecord).where(
|
||||||
AccountTrialAppRecord.app_id == app_id,
|
AccountTrialAppRecord.app_id == app_id,
|
||||||
AccountTrialAppRecord.account_id == account_id
|
AccountTrialAppRecord.account_id == account_id
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user