Open asiniy opened 8 years ago
It's a bit hacky, but I currently implement this by checking every week or so to find files that have been deleted in the database, then a vacuum task will go through the backend and remove them if they aren't referenced anymore. It isn't ideal, but it works for me at a small scale.
It does need to be implemented at some point in the future, though.
@keichan34 yeah, unfortunately you can't implement it without hack. Like:
Repo.get(Model, id)
|> Repo.delete
|> Exfile.VacuumFile # do it asynchroyously, of course
It's pretty simple thing, but I think it should be implemented later. The problem is (as I understood it from the code and current behaviour) that if we remove record from the database there is no automatic purging for its stored files (no matter when they are stored - in the b2, local-machine and so on).
This mechanism have to be implemented. WDYT?