-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Instead of copying files in adapters, create hard links where possible #2120
Conversation
destination | ||
end | ||
|
||
def link_or_copy_file(src, dest) | ||
begin |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Redundant begin
block detected.
63e555d
to
932d49d
Compare
FileUtils.mv(src, dest) | ||
end | ||
end | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Extra empty line detected at module body end.
932d49d
to
a78b5ec
Compare
@cbeckr you sent the PR to v4.3 but I'm not planning on adding new features to that version. Can you reopen your PR to master please? In master I got the following failures with your patch:
After we tame them, we'll merge. Thank you very much for sharing your work. |
Sounds great - rebased and resubmitted as #2290. I wasn't able to reproduce the errors following the guidelines in |
#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.
There is a problem with rights on Mac (Paperclip 5.2.1):
|
Just FYI - the problem is now resolved by setting read+write right on the created file. Because there is a hardlink, write right is required. |
thoughtbot#2290) Rebased thoughtbot#2120 to master. Paperclip duplicates the original files quite a lot as part of its validation process. (thoughtbot#1642, thoughtbot#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.
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.