mirror of
https://github.com/open-webui/open-webui.git
synced 2025-12-12 04:15:25 +00:00
Update prune.py
This commit is contained in:
parent
262848d647
commit
4c7e6bd752
1 changed files with 2 additions and 4 deletions
|
|
@ -742,17 +742,15 @@ def cleanup_audio_cache(max_age_days: Optional[int] = 30) -> None:
|
||||||
|
|
||||||
|
|
||||||
@router.post("/", response_model=Union[bool, PrunePreviewResult])
|
@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.
|
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=True (default), returns preview counts without deleting anything.
|
||||||
If dry_run=False, performs actual deletion and returns True on success.
|
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:
|
try:
|
||||||
if dry_run:
|
if form_data.dry_run:
|
||||||
log.info("Starting data pruning preview (dry run)")
|
log.info("Starting data pruning preview (dry run)")
|
||||||
|
|
||||||
# Get counts for all enabled operations
|
# Get counts for all enabled operations
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue