aboutsummaryrefslogtreecommitdiffstats
path: root/activestorage/lib/active_storage/service/disk_service.rb
diff options
context:
space:
mode:
authorGeorge Claghorn <george@basecamp.com>2018-04-29 07:01:44 -0400
committerGeorge Claghorn <george@basecamp.com>2018-04-29 07:07:59 -0400
commit5f2ee4c0bb790480a7032d1779052be2e1e46808 (patch)
tree060ff5db306afa03df2dee204fa3067726049401 /activestorage/lib/active_storage/service/disk_service.rb
parent8781b03b7ef4897a679f25220e73dce02bc43552 (diff)
downloadrails-5f2ee4c0bb790480a7032d1779052be2e1e46808.tar.gz
rails-5f2ee4c0bb790480a7032d1779052be2e1e46808.tar.bz2
rails-5f2ee4c0bb790480a7032d1779052be2e1e46808.zip
Stream blobs from disk in 5 MB chunks
Match other services, which all use a 5 MB chunk size.
Diffstat (limited to 'activestorage/lib/active_storage/service/disk_service.rb')
-rw-r--r--activestorage/lib/active_storage/service/disk_service.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/activestorage/lib/active_storage/service/disk_service.rb b/activestorage/lib/active_storage/service/disk_service.rb
index 5b652fe74e..b1b6f1ddcf 100644
--- a/activestorage/lib/active_storage/service/disk_service.rb
+++ b/activestorage/lib/active_storage/service/disk_service.rb
@@ -26,7 +26,7 @@ module ActiveStorage
if block_given?
instrument :streaming_download, key: key do
File.open(path_for(key), "rb") do |file|
- while data = file.read(64.kilobytes)
+ while data = file.read(5.megabytes)
yield data
end
end