[ARVADOS] updated: 33b559e83dedac970335819388b609ed01001db6

git at public.curoverse.com git at public.curoverse.com
Fri Sep 26 16:29:02 EDT 2014


Summary of changes:
 apps/workbench/app/controllers/collections_controller.rb | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

       via  33b559e83dedac970335819388b609ed01001db6 (commit)
      from  15869244560757aaa6187de437d73dbbdfb2e4db (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.


commit 33b559e83dedac970335819388b609ed01001db6
Author: Tom Clegg <tom at curoverse.com>
Date:   Fri Sep 26 16:26:27 2014 -0400

    3616: Use "ensure" to close response stream.

diff --git a/apps/workbench/app/controllers/collections_controller.rb b/apps/workbench/app/controllers/collections_controller.rb
index 9998251..9882fa6 100644
--- a/apps/workbench/app/controllers/collections_controller.rb
+++ b/apps/workbench/app/controllers/collections_controller.rb
@@ -156,10 +156,13 @@ 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]
-    file_enumerator(opts).each do |bytes|
-      response.stream.write bytes
+    begin
+      file_enumerator(opts).each do |bytes|
+        response.stream.write bytes
+      end
+    ensure
+      response.stream.close
     end
-    response.stream.close
   end
 
   def sharing_scopes

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list