Sha256: 89247ade689d1de7d85fb3a2ec5a17c6563256b929262ac4851d76aee364c387
Contents?: true
Size: 728 Bytes
Versions: 2
Compression:
Stored size: 728 Bytes
Contents
class Heroku::Scalr::Runner SIGNALS = %w[HUP INT TERM] & Signal.list.keys attr_reader :config # @param [String] config_path configuration file location def initialize(config_path) @config = Heroku::Scalr::Config.new(config_path) end # @return [Timers] recurring timers def timers @timers ||= Timers.new.tap do |t| config.apps.each do |app| app.log :info, "monitoring every #{app.interval}s" t.every(app.interval) { app.scale! } end end end # Start the runner def run! SIGNALS.each do |sig| Signal.trap(sig) { stop! } end loop { timers.wait } end # Stop execution def stop! Heroku::Scalr.logger.info "Exiting ..." exit(0) end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
heroku-scalr-0.2.0 | lib/heroku/scalr/runner.rb |
heroku-scalr-0.1.0 | lib/heroku/scalr/runner.rb |