fix: make remove-orphaned-files-on-storage management command work and safer (#29247)

This commit is contained in:
kurokobo
2025-12-08 10:48:05 +09:00
committed by GitHub
parent d998cbc18d
commit d66dceae16
2 changed files with 2 additions and 1 deletions

View File

@@ -1139,6 +1139,7 @@ def remove_orphaned_files_on_storage(force: bool):
click.echo(click.style(f"Found {len(all_files_in_tables)} files in tables.", fg="white"))
except Exception as e:
click.echo(click.style(f"Error fetching keys: {str(e)}", fg="red"))
return
all_files_on_storage = []
for storage_path in storage_paths:

View File

@@ -87,7 +87,7 @@ class OpenDALStorage(BaseStorage):
if not self.exists(path):
raise FileNotFoundError("Path not found")
all_files = self.op.list(path=path)
all_files = self.op.scan(path=path)
if files and directories:
logger.debug("files and directories on %s scanned", path)
return [f.path for f in all_files]