-
Notifications
You must be signed in to change notification settings - Fork 7
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
Add AWS S3 backend #61
Conversation
8270e62
to
e82a172
Compare
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.
Hello, I think it's fine, other than a small detail I mentioned in a comment, which may not be true.
If it's resolved, and you can also bring it in sync with the current master
, it can be merged!
@_wrap_aws_exception | ||
def does_paste_exist(paste_id): | ||
try: | ||
_s3.Object(_bucket, paste_id).load() |
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.
I assume the load()
function will actually download the paste content. If there a different function to check whether a specific key exists? If not, load()
is fine, but may cause double or triple downloads of the paste from the server.
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.
This should be fine. The documentation isn't entirely clear, but Object.load should just do a minimal (HEAD) request to check if the object exists. Object.get, on the other hand, will do a full (GET) request to download the object's contents.
Thanks for another great backend service! |
This pull request adds a storage backend based on Amazon AWS S3 storage system. See #15
The AWS S3 storage system allows us to treat:
paste
as an Amazon S3object
past_id
as an objectkey
(or key name)metadata
as an objectmetadata
(which is accessible in a limited way, and which cannot be merely modified)You find more information regarding Amazon S3 objects and their data, key, and metadata here.
Due to the lack of options, this PR does not implement any preventive approach for each communication with the Amazon S3 storage (e.g. setting a timeout).
This should be merged after #66 so that unrelated lint errors are fixed.
Pair-programmed with @c-w