Instead of copying files in adapters, create hard links where possible (#2290)
Rebased #2120 to master. Paperclip duplicates the original files quite a lot as part of its validation process. (#1642, #1326). When uploading large files (several hundred megabytes to gigabyte range), this becomes a problem: The web server will be busy creating 3 - 4 duplicates on disk, while the app (and potentially the user) are waiting for the upload operation to complete. This pull request introduces hard links instead of ```FileUtil.cp``` where possible to keep the logic as-is but save time and disk space.
Showing
Please
register
or
sign in
to comment