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

Uploaded file lifecycles #19

Open
rhsimplex opened this issue Jun 7, 2017 · 1 comment
Open

Uploaded file lifecycles #19

rhsimplex opened this issue Jun 7, 2017 · 1 comment

Comments

@rhsimplex
Copy link
Contributor

Uploaded pictures are dumped into a temp directory and never managed past that point. They should be cleaned up at some interval.

@jan-xyz
Copy link
Contributor

jan-xyz commented Apr 9, 2018

Ho sophisticated do you imagine this to be?

Right now all the pointers to the path are held in memory, and if the application terminates it's wiping the memory but not the files from disk. There are two options that I can come up with from the top of my head:

  1. Have the application scan the directory and look for available files instead of holding the references in memory. Cleaning up the file system can be handled by a cronjob
  2. Same as 1) but files get deleted when maximum amount of files is reached and a new file gets uploaded (Like a FIFO buffer).
  3. Store all references in a database and handle the lifecycle completely in Picasso (e.g. with Celery/Redis)

Your description sounds more like option 3 but I am more leaning towards 2 because it doesn't require any more infrastructure and is probably the simplest to implement. Additionally, it has the least amount of surprise for the user, IMHO. It only does something when the user interacts with it and no magic in the background is cleaning up the files.

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