From 4c7e6bd752f58f3f9b785a75a3cd5f34835a0902 Mon Sep 17 00:00:00 2001 From: Classic298 <27028174+Classic298@users.noreply.github.com> Date: Fri, 22 Aug 2025 16:43:06 +0200 Subject: [PATCH] Update prune.py --- backend/open_webui/routers/prune.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/backend/open_webui/routers/prune.py b/backend/open_webui/routers/prune.py index 4c6db6b60b..ccc9950d62 100644 --- a/backend/open_webui/routers/prune.py +++ b/backend/open_webui/routers/prune.py @@ -742,17 +742,15 @@ def cleanup_audio_cache(max_age_days: Optional[int] = 30) -> None: @router.post("/", response_model=Union[bool, PrunePreviewResult]) -async def prune_data(form_data: PruneDataForm, dry_run: bool = True, user=Depends(get_admin_user)): +async def prune_data(form_data: PruneDataForm, user=Depends(get_admin_user)): """ Prunes old and orphaned data using a safe, multi-stage process. If dry_run=True (default), returns preview counts without deleting anything. If dry_run=False, performs actual deletion and returns True on success. """ - log.info(f"DEBUG: dry_run parameter = {dry_run}") - log.info(f"DEBUG: form_data.dry_run = {form_data.dry_run}") try: - if dry_run: + if form_data.dry_run: log.info("Starting data pruning preview (dry run)") # Get counts for all enabled operations