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.
Python agentagentic-aiagentic-frameworkagentic-workflowaiautomationclaudedeepseekgenaigptllmlow-codemcpnextjsno-codeopenaipythonskillsworkflow
fix: optimize query for expired workflow runs by adding date filter and limiting results (#16491)
Yeuoly1907d2a90aea
diff --git a/api/services/clear_free_plan_tenant_expired_logs.py b/api/services/clear_free_plan_tenant_expired_logs.pyindex 25cad92e14c..5762bf9600a 100644--- a/api/services/clear_free_plan_tenant_expired_logs.py+++ b/api/services/clear_free_plan_tenant_expired_logs.py@@ -149,7 +149,15 @@ class ClearFreePlanTenantExpiredLogs:while True:with Session(db.engine).no_autoflush as session:- workflow_runs = session.query(WorkflowRun).filter(WorkflowRun.tenant_id == tenant_id).all()+ workflow_runs = (+ session.query(WorkflowRun)+ .filter(+ WorkflowRun.tenant_id == tenant_id,+ WorkflowRun.created_at < datetime.datetime.now() - datetime.timedelta(days=days),+ )+ .limit(batch)+ .all()+ )if len(workflow_runs) == 0:break