Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Autoremoving files if they models has been removed #46

Open
asiniy opened this issue Aug 16, 2016 · 2 comments
Open

Autoremoving files if they models has been removed #46

asiniy opened this issue Aug 16, 2016 · 2 comments
Milestone

Comments

@asiniy
Copy link
Contributor

asiniy commented Aug 16, 2016

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?

@keichan34
Copy link
Owner

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 keichan34 added this to the v0.5 milestone Aug 16, 2016
@asiniy
Copy link
Contributor Author

asiniy commented Aug 17, 2016

@keichan34 yeah, unfortunately you can't implement it without hack. Like:

Repo.get(Model, id)
|> Repo.delete
|> Exfile.VacuumFile # do it asynchroyously, of course

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants