From d2dc193066222b279faa52a66a22760e739dd87e Mon Sep 17 00:00:00 2001 From: Louise Crow Date: Thu, 13 Dec 2012 20:15:54 +0000 Subject: Put download zips in a predictable location - sharded folders based on request ID, rather than distributing them across the download directories by the generated SHA. Preserve the uniqueness of the subdirectory. --- app/controllers/application_controller.rb | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'app/controllers/application_controller.rb') diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 239d49a6c..d8f7f9ea7 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -229,6 +229,11 @@ class ApplicationController < ActionController::Base end end + def request_dirs(info_request) + first_three_digits = info_request.id.to_s()[0..2] + File.join(first_three_digits.to_s, info_request.id.to_s) + end + def download_zip_dir() File.join(Rails.root, '/cache/zips/') end -- cgit v1.2.3