mirror of
https://git.mirrors.martin98.com/https://github.com/langgenius/dify.git
synced 2025-04-18 11:49:41 +08:00
fix: add batch size to ClearFreePlainTenantExpiredLogs to avoid blocking
This commit is contained in:
parent
83136ee4e8
commit
3835ae9364
@ -149,7 +149,9 @@ 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).limit(batch).all()
|
||||
)
|
||||
|
||||
if len(workflow_runs) == 0:
|
||||
break
|
||||
|
Loading…
x
Reference in New Issue
Block a user