diff options
author | Louise Crow <louise.crow@gmail.com> | 2012-12-13 20:15:54 +0000 |
---|---|---|
committer | Louise Crow <louise.crow@gmail.com> | 2012-12-13 20:15:54 +0000 |
commit | d2dc193066222b279faa52a66a22760e739dd87e (patch) | |
tree | 603a0437ac502b827c9b08eb5c1d3764ed72ce1d /app/controllers/application_controller.rb | |
parent | 611411fc7907a97e3aa8c2339bc9f5b70a5d1a01 (diff) |
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.
Diffstat (limited to 'app/controllers/application_controller.rb')
-rw-r--r-- | app/controllers/application_controller.rb | 5 |
1 files changed, 5 insertions, 0 deletions
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 |