Skip to content

armgit / dify

Public Imported from GitHub
0

Build Agentic workflows, RAG pipelines, with rich AI model and tool support on one collaborative workspace. Deploy on cloud, VPC, or self-hosted, so teams move from prototype to production without rebuilding the stack.

update delete embeddings by id (#6489)

Jyongf73a3a58ae61
diff --git a/api/schedule/clean_embedding_cache_task.py b/api/schedule/clean_embedding_cache_task.py
index 49b1be3a339..ccc1062266a 100644
--- a/api/schedule/clean_embedding_cache_task.py
+++ b/api/schedule/clean_embedding_cache_task.py
@@ -25,9 +25,10 @@ def clean_embedding_cache_task():
except NotFound:
break
if embedding_ids:
- db.session.execute(text(
- "DELETE FROM embeddings WHERE id in :embedding_ids"
- ), {'embedding_ids': tuple(embedding_ids)})
+ for embedding_id in embedding_ids:
+ db.session.execute(text(
+ "DELETE FROM embeddings WHERE id = :embedding_id"
+ ), {'embedding_id': embedding_id})
db.session.commit()
else: