Skip to content

Instantly share code, notes, and snippets.

@lwoodson
Last active January 3, 2016 00:09
Show Gist options
  • Save lwoodson/8381188 to your computer and use it in GitHub Desktop.
Save lwoodson/8381188 to your computer and use it in GitHub Desktop.
pools = ActiveRecord::Base.connection_handler.connection_pools.values
pools.each do |pool|
pool.connections.each{|connection| connection.reconnect!}
end
# Meanwhile, in rails console...
employer_ids = Employer.where(db_host: 0).limit(10).pluck(:id)
employer_ids << Employer.where(db_host: 1).limit(10).pluck(:id)
employer_ids << Employer.where(db_host: 2).limit(10).pluck(:id)
employer_ids.flatten!
500.times{Resque.enqueue_to(:A, DBTickler, 200, 0.05, *employer_ids)}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment