fix: xxx is not bound to a Session (#24966)
This commit is contained in:
@@ -453,7 +453,7 @@ class AdvancedChatAppGenerator(MessageBasedAppGenerator):
|
|||||||
# release database connection, because the following new thread operations may take a long time
|
# release database connection, because the following new thread operations may take a long time
|
||||||
db.session.refresh(workflow)
|
db.session.refresh(workflow)
|
||||||
db.session.refresh(message)
|
db.session.refresh(message)
|
||||||
db.session.refresh(user)
|
# db.session.refresh(user)
|
||||||
db.session.close()
|
db.session.close()
|
||||||
|
|
||||||
# return response or stream generator
|
# return response or stream generator
|
||||||
|
@@ -145,7 +145,10 @@ class AccountService:
|
|||||||
if naive_utc_now() - account.last_active_at > timedelta(minutes=10):
|
if naive_utc_now() - account.last_active_at > timedelta(minutes=10):
|
||||||
account.last_active_at = naive_utc_now()
|
account.last_active_at = naive_utc_now()
|
||||||
db.session.commit()
|
db.session.commit()
|
||||||
|
# NOTE: make sure account is accessible outside of a db session
|
||||||
|
# This ensures that it will work correctly after upgrading to Flask version 3.1.2
|
||||||
|
db.session.refresh(account)
|
||||||
|
db.session.close()
|
||||||
return account
|
return account
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
|
Reference in New Issue
Block a user