Module: Eye::Process::Trigger
- Included in:
- Eye::Process
- Defined in:
- lib/eye/process/trigger.rb
Instance Method Summary collapse
- #add_triggers ⇒ Object
- #check_triggers(transition) ⇒ Object
- #remove_triggers ⇒ Object
- #retry_start_after_flapping ⇒ Object
Instance Method Details
#add_triggers ⇒ Object
3 4 5 6 7 8 9 |
# File 'lib/eye/process/trigger.rb', line 3 def add_triggers if self[:triggers] self[:triggers].each do |type, cfg| add_trigger(cfg) end end end |
#check_triggers(transition) ⇒ Object
15 16 17 |
# File 'lib/eye/process/trigger.rb', line 15 def check_triggers(transition) self.triggers.each { |trigger| trigger.notify(transition, state_reason) } end |
#remove_triggers ⇒ Object
11 12 13 |
# File 'lib/eye/process/trigger.rb', line 11 def remove_triggers self.triggers = [] end |
#retry_start_after_flapping ⇒ Object
19 20 21 22 23 24 25 |
# File 'lib/eye/process/trigger.rb', line 19 def retry_start_after_flapping return unless unmonitored? return unless state_reason.to_s.include?('flapping') # TODO: remove hackety schedule :start, Eye::Reason.new(:'retry start after flapping') self.flapping_times += 1 end |