-
-
Notifications
You must be signed in to change notification settings - Fork 44
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
Extract user photos from submissions and make available via S3 #1701
Comments
I don't think we save submissions in S3 anymore. We used to store them, but after introducing entities, we are not saving them. |
Oh of course 🤦♂️ We can think of something! |
When we get the submission zip during the endpoint call, could we run a BackgroundTask at the end to extract the images and place them on S3, if they don't exist? |
There is object https://min.io/docs/minio/linux/developers/python/API.html#stat_object We could add that to s3.py as a function to check object exists. Raise an exception if it's doesn't exist. Catch the exception and do a So for each available image we would check if it exists, and if not upload |
This solution isn't scalable though. What we should probably do is add a new db table called Ideally we should get the submissions first with Then we can quickly check the submission JSON for any new submissions that include a reference to an attachment image we don't have in our DB. If a new image is present, in a background task we get the submissions again with
Do you think this is possible? |
Is your feature request related to a problem? Please describe.
fmtm-data/{org_id}/{project_id}/submission.zip
.Describe the solution you'd like
submission.zip
, we should extract out the images.fmtm-data/{org_id}/{project_id}/images/{entity_id}.jpeg
fmtm-data/{org_id}/{project_id}/images/1-{entity_id}.jpeg
fmtm-data/{org_id}/{project_id}/images/2-{entity_id}.jpeg
fmtm-data/{org_id}/{project_id}/images/3-{entity_id}.jpeg
Additional considerations
attachments=false
for a fast response.The text was updated successfully, but these errors were encountered: