Skip to content
This repository has been archived by the owner on Dec 16, 2023. It is now read-only.

Cleanup liberation data #107

Open
moggers87 opened this issue Nov 20, 2015 · 2 comments · May be fixed by #590
Open

Cleanup liberation data #107

moggers87 opened this issue Nov 20, 2015 · 2 comments · May be fixed by #590

Comments

@moggers87
Copy link
Member

Now we've moved back to file-based storage for liberations, we don't have any code to remove the old liberation tarball.

Firing off a separate task when liberation is started will probably do.

@moggers87
Copy link
Member Author

I attempted to implement this a while ago, but came up against the issue with atomicity - a file could be written while the liberation object is still in a transaction (i.e. we can't read it in our process). There was no way I could be sure this file wasn't being referenced somewhere.

One way we could get around this is to have a separate LiberationFile model and give the Liberation model a nullable relation to the new model. That way we only need to search for LiberationFile objects that aren't referenced by a Liberation object. Any transaction funniness can be dealt with there and we can safely delete that object and then the file (I think there's a post-commit thing we can use?).

@moggers87
Copy link
Member Author

Another option would be to only move files to the final liberation folder once they've been finished with - i.e. we know the Liberation object will already be committed. This option is a lot easier to explain and implement, so I think that's what we'll do ☺

@moggers87 moggers87 linked a pull request Jun 25, 2021 that will close this issue
moggers87 added a commit that referenced this issue Jun 25, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant