Skip to content
This repository has been archived by the owner on Jan 8, 2022. It is now read-only.

tell carrierwave to use move instead of copy during uploads #149

Merged
merged 1 commit into from
Jan 14, 2020

Conversation

peetucket
Copy link
Contributor

@peetucket peetucket commented Aug 10, 2017

@peetucket peetucket force-pushed the use-move-instead-of-copy-for-uploads branch from d169d36 to 413095d Compare August 10, 2017 17:20
@peetucket peetucket force-pushed the use-move-instead-of-copy-for-uploads branch from 413095d to 9be4790 Compare August 10, 2017 17:21
@peetucket peetucket changed the title tell carrierwave not to use move instead of copy during uploads tell carrierwave to use move instead of copy during uploads Aug 10, 2017
@@ -18,6 +18,19 @@ class FileUploader < CarrierWave::Uploader::Base
before :store, :remember_cache_id
after :store, :delete_tmp_dir

##
# By default, CarrierWave copies an uploaded file twice, first copying the file into the cache, then copying the file into the store.
# For large files, this can be prohibitively time consuming.
Copy link
Contributor

Choose a reason for hiding this comment

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

What's the reason for doing this? Are we seeing this as an issue? Are these directories on the same file system?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

There are occasional issues where a very big file fails to upload correctly and/or where the tmp space fills up. Thought this could potentially help those scenarios by avoiding a seemingly unnecessary big file copy, but I don't have data to back that up.

@ndushay
Copy link
Contributor

ndushay commented Jan 8, 2020

can this be closed and the branch removed? it's over 2 years old.

@hannahfrost
Copy link
Contributor

After some discussion with @peetucket, I propose we pick this work back up rather than dispose of it, assuming that it doesn't require much time to complete. Users, and SDR service team members, would benefit from this change.

@justinlittman justinlittman merged commit e2eb598 into master Jan 14, 2020
@justinlittman justinlittman deleted the use-move-instead-of-copy-for-uploads branch January 14, 2020 17:11
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants