rakefile task to prime redis proxy ssl

This commit is contained in:
Kyle Drake 2017-06-29 11:17:24 -07:00
parent 50b32257df
commit bf2fec7cf9

View file

@ -435,3 +435,15 @@ task :prime_follow_count => [:environment] do
DB['update sites set follow_count=? where id=?', count, site.id].first
end
end
desc 'prime_redis_proxy_ssl'
task :prime_redis_proxy_ssl => [:environment] do
site_ids = DB[%{
select id from sites where domain is not null and ssl_cert is not null and ssl_key is not null
and is_deleted != ? and is_banned != ?
}, true, true].all.collect {|site_id| site_id[:id]}
site_ids.each do |site_id|
Site[site_id].store_ssl_in_redis_proxy
end
end