[ARVADOS] created: 15869244560757aaa6187de437d73dbbdfb2e4db

git at public.curoverse.com git at public.curoverse.com
Fri Sep 26 15:46:32 EDT 2014


        at  15869244560757aaa6187de437d73dbbdfb2e4db (commit)


commit 15869244560757aaa6187de437d73dbbdfb2e4db
Author: Tom Clegg <tom at curoverse.com>
Date:   Fri Sep 26 15:46:09 2014 -0400

    3616: Use ActionController::Live to avoid buffering entire response in memory.

diff --git a/apps/workbench/app/controllers/collections_controller.rb b/apps/workbench/app/controllers/collections_controller.rb
index f87579e..9998251 100644
--- a/apps/workbench/app/controllers/collections_controller.rb
+++ b/apps/workbench/app/controllers/collections_controller.rb
@@ -1,4 +1,6 @@
 class CollectionsController < ApplicationController
+  include ActionController::Live
+
   skip_around_filter(:require_thread_api_token,
                      only: [:show_file, :show_file_links])
   skip_before_filter(:find_object_by_uuid,
@@ -154,7 +156,10 @@ class CollectionsController < ApplicationController
       Rack::Mime::MIME_TYPES[ext] || 'application/octet-stream'
     self.response.headers['Content-Length'] = params[:size] if params[:size]
     self.response.headers['Content-Disposition'] = params[:disposition] if params[:disposition]
-    self.response_body = file_enumerator opts
+    file_enumerator(opts).each do |bytes|
+      response.stream.write bytes
+    end
+    response.stream.close
   end
 
   def sharing_scopes

-----------------------------------------------------------------------


hooks/post-receive
-- 




More information about the arvados-commits mailing list