This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| module Resque | |
| def self.unregister_workers_for_host(host) | |
| Resque.workers.select{|worker| worker.id.split(':').first==host}.each(&:unregister_worker) | |
| end | |
| end | |
| Resque.unregister_workers_for_host("ip-10-250-192-51") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| gem 'koala' | |
| gem 'resque' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require 'rubygems' | |
| require 'rest-client' | |
| require 'yaml' | |
| config = YAML::load(File.read('/usr/lib/elasticsearch/config/elasticsearch.yml')) | |
| config['discovery']['zen']['ping']['unicast']['hosts'].split(', ').collect{|h| h.sub(':9300', '') }.each do |host| | |
| puts RestClient.get("http://#{host}:9200/_cluster/health").inspect | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| path: | |
| work: /var/lib/elasticsearch/work | |
| logs: /var/log/elasticsearch | |
| data: /var/lib/elasticsearch/data | |
| cluster: | |
| name: mycluster | |
| discovery: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| clientSideValidations.callbacks.form.fail = function(form, eventData) { | |
| $.scrollTo('.error', 500, {offset:{left:0,top:-25}} ); | |
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ActionMailer::Base.default_url_options[:host] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| when %r{(?:http://www.ourapp.com|^)(/.*)} | |
| $1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| if ENV['RUBY_PROF'].present? | |
| require 'ruby-prof' | |
| RubyProf.start | |
| at_exit do | |
| results = RubyProf.stop | |
| File.open "#{Rails.root}/tmp/profile-graph.html", 'w' do |file| | |
| RubyProf::GraphHtmlPrinter.new(results).print(file) | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| module ResqueJob | |
| class CheckMailDelivery | |
| @queue = :medium | |
| def self.perform | |
| gmail = Gmail.connect('stillalive.features', 'ourlittlesecret') | |
| raise "Still Alive mails not being delivered" if gmail.mailbox('[Gmail]/All Mail').emails.last.date.to_time < 30.minutes.ago | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| module ResqueJob | |
| class ActiveSanityJob | |
| @queue = :medium | |
| def self.perform | |
| ActiveSanity::Checker.check! | |
| raise "Invalid Records in your database. Check http://#{ActionMailer::Base.default_url_options[:host]}/admin/invalid_records for more details" if InvalidRecord.any? | |
| end | |
| end | |
| end |
OlderNewer