sandbox doesn't provide auto disable log (#12388)

This commit is contained in:
Jyong 2025-01-06 15:57:13 +08:00 • committed by GitHub
commit 9c317b64c3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 6 additions and 17 deletions

View file

@ -168,23 +168,6 @@ def clean_unused_datasets_task():
else:
plan = plan_cache.decode()
if plan == "sandbox":
# add auto disable log
documents = (
db.session.query(Document)
.filter(
Document.dataset_id == dataset.id,
Document.enabled == True,
Document.archived == False,
)
.all()
)
for document in documents:
dataset_auto_disable_log = DatasetAutoDisableLog(
tenant_id=dataset.tenant_id,
dataset_id=dataset.id,
document_id=document.id,
)
db.session.add(dataset_auto_disable_log)
# remove index
index_processor = IndexProcessorFactory(dataset.doc_form).init_index_processor()
index_processor.clean(dataset, None)