-
Notifications
You must be signed in to change notification settings - Fork 432
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
feat: write objects to blob storage #8429
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry if this a comment on code not intended to be ready for review, but I happened to look... one comment inline.
Also, for testing I wonder if we want a fake blob Storage class that does only what we need for that it's being called as intended. If we make that work with your storage_utils
, the tests wouldn't even have to know. If the need arose, we could also test against a real blob store by adjusting the configuration.
# See, however, the note about "major system failures" at "unknown_ids" | ||
blobname = f"{ext[1:]}/{basename}" | ||
if exists_in_storage("active-draft", blobname): | ||
remove_from_storage("active-draft", blobname) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just call remove_from_storage()
and handle an exception if it complains about blobs that don't exist? The code needs to handle that possibility anyway, e.g., due to a race.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The implemenation in django-storages (and in boto3) explicitly say it is not an error to remove something that doesn't exist.
# Conflicts: # ietf/settings.py
The photos / thumbs were already dropped in the same directory, so let's not add a distinction at this point.
No description provided.