mirror of
https://github.com/langgenius/dify.git
synced 2026-06-26 14:51:13 +08:00
Merge 3b8559521d into a246dc8b17
This commit is contained in:
commit
dbb7d04dad
@ -1030,6 +1030,9 @@ class DatasetRetrieval:
|
||||
):
|
||||
"""
|
||||
Persist dataset query audit rows for retrieval requests.
|
||||
|
||||
Uses an independent session to avoid committing the request-scoped
|
||||
db.session, which would break transaction isolation for the caller.
|
||||
"""
|
||||
if not query and not attachment_ids:
|
||||
return
|
||||
@ -1059,9 +1062,9 @@ class DatasetRetrieval:
|
||||
created_by=created_by,
|
||||
)
|
||||
dataset_queries.append(dataset_query)
|
||||
if dataset_queries:
|
||||
db.session.add_all(dataset_queries)
|
||||
db.session.commit()
|
||||
if dataset_queries:
|
||||
with sessionmaker(bind=db.engine).begin() as session:
|
||||
session.add_all(dataset_queries)
|
||||
|
||||
def _retriever(
|
||||
self,
|
||||
|
||||
Loading…
Reference in New Issue
Block a user