aboutsummaryrefslogtreecommitdiffstats
path: root/script/rails-deploy-while-down
diff options
context:
space:
mode:
authorMark Longair <mhl@pobox.com>2013-11-13 15:34:07 +0000
committerMark Longair <mhl@pobox.com>2013-11-14 12:51:03 +0000
commit96b3b5adbdafb25e5ab6ca94b89d6682a2e8f0e4 (patch)
treecb80880e7ac414d1bc90a2f5876afcf64a28c8ae /script/rails-deploy-while-down
parent2ca432a86623266c7f11a067a0dc87be6f509d6e (diff)
Reduce the memory used to serve /body/all-authorities.csv
On WDTK, /body/all-authorities was using lots of memory - this commit reduces that by (a) fetching the public bodies in batches, rather than keeping them all in memory at one time and (b) writing the CSV to a file and then returning it with X-Sendfile (or equivalent), rather than returning the whole file from memory with send_data. There's a FIXME to do with the layout of download directories; if that's changed, the example nginx config, etc. will need to be updated too. This commit also adds a basic test for reasonable CSV being returned and switches from FasterCSV to CSV in order to fix this NotImplementedError under Ruby 1.9: Please switch to Ruby 1.9's standard CSV library. It's FasterCSV plus support for Ruby 1.9's m17n encoding engine. (The CSV version seems to still work fine under 1.8.7.)
Diffstat (limited to 'script/rails-deploy-while-down')
0 files changed, 0 insertions, 0 deletions