b2share
b2share copied to clipboard
files: add a files garbage-collector
Problem: Deleting a record or a Deposit also deletes the bucket and the ObjectVersion, but the FileInstance is still kept and the actual file is not deleted from the file-system.
Solution: We should delete any FileInstance which is not referenced by any ObjectVersion, as well as the actual file.
Note: deletion of the actual file should be done before deleting the FileInstance in order to avoid having files which are not referenced anywhere in the DB.