dify/api/configs
echooffx 34793e0d92 feat(api): add scheduled cleanup task for dataset_queries
The dataset_queries table grows without bound because every RAG retrieval
and hit-test inserts a row. This adds a configurable Celery Beat task
(clean_dataset_queries_task) that deletes rows older than a retention
period (default 60 days) in batches, gated by ENABLE_CLEAN_DATASET_QUERIES_TASK.

Retention is clamped to max(config, PLAN_SANDBOX_CLEAN_DAY_SETTING) to
avoid breaking clean_unused_datasets_task which reads DatasetQuery.created_at.

Also adds a created_at index on dataset_queries via alembic migration
to keep the delete scan performant as the table grows.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-04-30 16:04:02 +08:00
..
deploy feat: add debug log for request and response (#19781) (#19783) 2025-05-17 17:31:09 +08:00
enterprise feat: enterprise otel exporter (#33138) 2026-03-27 07:56:31 +00:00
extra feat: add archive storage client and env config (#30422) 2025-12-31 16:14:46 +08:00
feature feat(api): add scheduled cleanup task for dataset_queries 2026-04-30 16:04:02 +08:00
middleware feat: support configurable redis key prefix (#35139) 2026-04-14 09:31:41 +00:00
observability feat: add otel endpoint config (#22492) 2025-07-16 18:24:17 +08:00
packaging fix: resolve typing errors in configs module (#25268) 2025-09-06 16:08:14 +08:00
remote_settings_sources more httpx (#25651) 2025-09-22 23:07:09 +08:00
__init__.py feat: knowledge pipeline (#25360) 2025-09-18 12:49:10 +08:00
app_config.py feat: enterprise otel exporter (#33138) 2026-03-27 07:56:31 +00:00