This is an automated email from the ASF dual-hosted git repository. rubys pushed a commit to branch roster_on_vue in repository https://gitbox.apache.org/repos/asf/whimsy.git
commit f9179099cf8692b3ce02a5947a4d4ded6beb436a Author: Sam Ruby <[email protected]> AuthorDate: Wed Sep 6 08:20:34 2017 -0400 cache index --- www/roster/main.rb | 30 ++++++++++++++++++++---------- 1 file changed, 20 insertions(+), 10 deletions(-) diff --git a/www/roster/main.rb b/www/roster/main.rb index 942f634..8925dae 100755 --- a/www/roster/main.rb +++ b/www/roster/main.rb @@ -54,17 +54,27 @@ get '/committee' do redirect to('/committee/') end +@index = nil +@index_time = nil get '/committer/index.json' do - # bulk loading the mail information makes things go faster - mail = Hash[ASF::Mail.list.group_by(&:last). - map {|person, list| [person, list.map(&:first)]}] - - # return a list of people, their public-names, and email addresses - ASF::Person.list.sort_by(&:id).map {|person| - result = {id: person.id, name: person.public_name, mail: mail[person]} - result[:member] = true if person.asf_member? - result - }.to_json + @index = nil unless @index_time and Time.now-@index_tine < 300 + + if not @index + # bulk loading the mail information makes things go faster + mail = Hash[ASF::Mail.list.group_by(&:last). + map {|person, list| [person, list.map(&:first)]}] + + # return a list of people, their public-names, and email addresses + @index = ASF::Person.list.sort_by(&:id).map {|person| + result = {id: person.id, name: person.public_name, mail: mail[person]} + result[:member] = true if person.asf_member? + result + } + end + + _json do + @index + end end get '/committee/:name.json' do |name| -- To stop receiving notification emails like this one, please contact "[email protected]" <[email protected]>.
