feat: add administrative commands to free up storage space by removing unused files (#18835)

This commit is contained in:
kurokobo
2025-04-27 12:11:04 +09:00
committed by GitHub
parent b62eb61400
commit 993ef87dca
5 changed files with 286 additions and 0 deletions

View File

@@ -30,3 +30,11 @@ class BaseStorage(ABC):
@abstractmethod
def delete(self, filename):
raise NotImplementedError
def scan(self, path, files=True, directories=False) -> list[str]:
"""
Scan files and directories in the given path.
This method is implemented only in some storage backends.
If a storage backend doesn't support scanning, it will raise NotImplementedError.
"""
raise NotImplementedError("This storage backend doesn't support scanning")