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

Implement AWS as a cache storage #18

Conversation

filipegiusti
Copy link
Contributor

The commits carrierwaveuploader/carrierwave@7a993542701b that's related to carrierwaveuploader/carrierwave#1312 added the option to switch cache storages. carrierwave-aws needs that.

However the carrierwave version with the functionality wasn't published yet, so this implementation isn't ready to be merged, this PR is a WIP to get the code ready for when that's published.

@filipegiusti
Copy link
Contributor Author

Also I would like to get some input if it's worth to implement copy AND move selected by carrierwave configuration. I don't see any advantage.

@sorentwo
Copy link
Contributor

sorentwo commented May 2, 2014

@filipegiusti I agree, there doesn't appear to be any benefit to implementing both copy and move.

@@ -73,11 +91,23 @@ def size
end

def store(new_file)
@file = bucket.objects[path].write(uploader_write_options(new_file))
if new_file.is_a?(self.class)
new_file.move_to(path)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The return value of move_to is self, whereas the return value otherwise is a file object. I'm not sure if this has any repercussions in libraries where people are using the value returned from store.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The #store return value is always true, not sure why.

As the only documentation was the code, I copied the behavior of https://github.com/carrierwaveuploader/carrierwave/blob/master/lib/carrierwave/storage/fog.rb#L324 and https://github.com/carrierwaveuploader/carrierwave/blob/master/lib/carrierwave/storage/fog.rb#L415 that seems to be good enough.

@sorentwo
Copy link
Contributor

@filipegiusti: It doesn't look like a new CarrierWave version has been released. Still leaving this hanging?

@filipegiusti
Copy link
Contributor Author

I'm not sure what to do. But I can tell you I've been using this code in production since May.

@sorentwo
Copy link
Contributor

Perhaps we can pull this next year at the rate CarrierWave releases new versions. I'm going to close it out for now though, just to thin the issue box.

@sorentwo sorentwo closed this Nov 10, 2014
@fschwahn
Copy link
Contributor

@sorentwo the final of carrierwave 1.0 was released, so I think it would make sense to reconsider this PR.

@sorentwo
Copy link
Contributor

@fschwahn Thanks for letting me know. Can't believe it has been 2.5 years!

@filipegiusti Any chance you want to pick this back up and finish it off? If not, I'll start from what you worked on.

@filipegiusti
Copy link
Contributor Author

@sorentwo I will try to finish this before carnival, so if you don't hear from me before Saturday, feel free to tackle it.

@fschwahn
Copy link
Contributor

In fact I already implemented it as I needed it for a project - I can submit a new PR, if @filipegiusti is ok with it?

@filipegiusti
Copy link
Contributor Author

@fschwahn I'm 😃 with it. Submit it!

@fschwahn fschwahn mentioned this pull request Feb 23, 2017
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

Successfully merging this pull request may close these issues.

3 participants