Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Additional caching #6

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/graphviz_config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def set_graphviz_defaults(gparams={})
gparams[:program] ||= "neato"
gparams[:analysis] ||= "member"
gparams[:start_date] ||= 5.years.ago.to_date.to_s(:justdate)
gparams[:end_date] ||= Date.tomorrow.to_s(:justdate)
gparams[:end_date] ||= Date.today.to_s(:justdate)
gparams[:format] ||= "svg"
if gparams[:analysis].include?("org_org")
gparams[:stringency] ||= "10"
Expand Down
19 changes: 17 additions & 2 deletions lib/tasks/clean_and_curl.rake
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,13 @@ namespace :cache do
run_ajax_curl tag_cloud_investigator_url(:id => inv.username)
run_curl publications_investigator_url(:id => inv.username)
run_json_curl publications_investigator_url(:id => inv.username, :format => 'json')
run_curl show_investigator_url(:id => inv.username, :page => 1)

abs = Abstract.display_investigator_data(inv.id)
puts "Abstract pages for #{inv.username}: #{abs.total_pages}"
(1..abs.total_pages).each do |i|
run_curl show_investigator_url(:id => inv.username, :page => i)
end

#run_curl url_for :controller => 'investigators', :action => 'show', :id => inv.username, :page => 1
end
end
Expand Down Expand Up @@ -128,7 +134,14 @@ namespace :cache do
run_curl stats_orgs_url
@AllOrganizations.each do |org|
run_curl show_investigators_org_url(org.id)
run_curl url_for :controller => 'orgs', :action => 'show', :id => org.id, :page => 1

abs = org.abstract_data
puts "Total pages for #{org.name}: #{abs.total_pages}."
# Only do the first 10 pages.
(1..[abs.total_pages, 10].min).each do |i|
run_curl url_for :controller => 'orgs', :action => 'show', :id => org.id, :page => i
end

run_curl full_show_org_url(:id => org.id)
run_ajax_curl tag_cloud_org_url(:id => org.id)
run_ajax_curl short_tag_cloud_org_url(:id => org.id)
Expand Down Expand Up @@ -233,6 +246,7 @@ namespace :cache do
run_curl build_graphviz_restfulpath(params, params[:format])
params[:analysis] = "org_org"
params[:stringency] = "1"
params[:distance] = "0"
run_curl build_graphviz_restfulpath(params, params[:format])
params[:analysis] = "org_mesh"
params[:stringency] = "2000"
Expand All @@ -245,6 +259,7 @@ namespace :cache do
if ENV["taskname"].nil?
puts "sorry. You need to call 'rake cache:populate taskname=task' where task is one of #{tasknames.join(', ')}"
else
puts "curl_host is #{LatticeGridHelper.curl_host}"
taskname = ENV["taskname"]
block_timing("cache:populate taskname=#{taskname}") {
case
Expand Down