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

Don't read file twice in sanitized_file #1476

Conversation

felixbuenemann
Copy link
Contributor

This can cause excess extra traffic and memory usage when using cache! or directly calling sanitized_file, especially with fog. Also removed what seems to be a useless read in the if block.

I added some specs for the normal case, but the case where file.read returns a File is not tested, because I have no idea how to reproduce that situation. It seems to be related to an old issue #814.

This can cause excess extra traffic and memory usage, especially with
fog. Also remove what seems to be a useless read in the if block and
added some initial specs for sanitized_file.
@felixbuenemann
Copy link
Contributor Author

I only ran the local tests which were fine, have to setup a test bucket to see what wrong with the specs.

@felixbuenemann
Copy link
Contributor Author

The spec failures are unrelated:
master: 1304 examples, 35 failures, 1 pending
fix-sanitized_file-double-read: 1306 examples, 35 failures, 1 pending

@thiagofm
Copy link
Member

We are having a problem with one gem dependency called fog atm.

bensie added a commit that referenced this pull request Nov 19, 2014
…e-read

Don't read file twice in sanitized_file
@bensie bensie merged commit a680af1 into carrierwaveuploader:master Nov 19, 2014
@bensie
Copy link
Member

bensie commented Nov 19, 2014

Thanks!

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.

None yet

3 participants