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

Processing before storing #128

Closed
jatkins opened this issue Mar 28, 2013 · 3 comments
Closed

Processing before storing #128

jatkins opened this issue Mar 28, 2013 · 3 comments

Comments

@jatkins
Copy link

jatkins commented Mar 28, 2013

I am using carrierwave_backgrounder along with S3 to process image uploads. Is there any way to have the processing done before the file is moved to S3?

I have googled and googled for an answer and can't find anything on the subject.

@lardawge
Copy link
Owner

I am a bit lost on what you are trying to do... If you want to process and store images on s3, carrierwave will already do this.

@jatkins
Copy link
Author

jatkins commented Mar 28, 2013

Sorry for the bad wording, and possible (very likely) confusion on my part. What I'm wanting to do is to allow my users to upload an image, and before its moved to S3 have backgrounder take over process the image and then upload it to S3. My understand is that once the image is uploaded to my app, it is then uploaded to S3 as well. Then once backgrounder gets to that image it downloads it from S3, processed it, then uploads it again.

Am I mistaken in this understanding?

@lardawge
Copy link
Owner

It depends on which method you use.

process_in_background behaves the way you "understand".

store_in_background (could be called store_and_process_in_background) does what you are asking for...

Keep in mind, If you deploy to multiple servers or your background processes are run on separate servers and do not have access to a central tmp directory, you will have many errors caused by the background task not being able to find the tmp file. This is the case if you deploy to Heroku which is why I created process_in_baackground.

process_in_background useful if you have many versions that need to be created or are processing large files... otherwise the payoff is minimal.

Sounds like store_in_background is what you're looking for.

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