mirror of
https://github.com/langgenius/dify.git
synced 2026-09-24 23:22:26 +08:00
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
This commit is contained in:
co-authored by
autofix-ci[bot]
parent
2f99652203
commit
45957225cd
@@ -6,7 +6,7 @@ import uuid
|
||||
from datetime import UTC, datetime
|
||||
from typing import TypedDict, cast
|
||||
|
||||
from sqlalchemy import select
|
||||
from sqlalchemy import select, update
|
||||
from sqlalchemy.orm import Session
|
||||
|
||||
from core.db.session_factory import session_factory
|
||||
@@ -912,12 +912,11 @@ class SummaryIndexService:
|
||||
|
||||
# Disable summary records (don't delete)
|
||||
now = naive_utc_now()
|
||||
for summary in summaries:
|
||||
summary.enabled = False
|
||||
summary.disabled_at = now
|
||||
summary.disabled_by = disabled_by
|
||||
session.add(summary)
|
||||
|
||||
session.execute(
|
||||
update(DocumentSegmentSummary)
|
||||
.where(DocumentSegmentSummary.id.in_(s.id for s in summaries))
|
||||
.values(enabled=False, disabled_at=now, disabled_by=disabled_by)
|
||||
)
|
||||
session.commit()
|
||||
logger.info("Disabled %s summary records for dataset %s", len(summaries), dataset.id)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user