Class: Legion::Extensions::Extinction::Actor::ProtocolMonitor

Inherits:
Actors::Every
  • Object
show all
Defined in:
lib/legion/extensions/extinction/actors/protocol_monitor.rb

Overview

rubocop:disable Legion/Extension/EveryActorRequiresTime

Instance Method Summary collapse

Instance Method Details

#check_subtask?Boolean

Returns:

  • (Boolean)


32
33
34
# File 'lib/legion/extensions/extinction/actors/protocol_monitor.rb', line 32

def check_subtask?
  false
end

#generate_task?Boolean

Returns:

  • (Boolean)


36
37
38
# File 'lib/legion/extensions/extinction/actors/protocol_monitor.rb', line 36

def generate_task?
  false
end

#monitor_protocolObject



40
41
42
43
44
45
46
47
48
49
50
51
52
53
# File 'lib/legion/extensions/extinction/actors/protocol_monitor.rb', line 40

def monitor_protocol(**)
  state = build_state
  last_change = state[:last_change]
  stale       = check_stale(last_change)

  log.debug "[extinction] monitor_protocol: level=#{state[:current_level]} stale=#{stale}"

  {
    success:    true,
    state:      state,
    stale:      stale,
    checked_at: Time.now.utc.iso8601
  }
end

#run_now?Boolean

Returns:

  • (Boolean)


24
25
26
# File 'lib/legion/extensions/extinction/actors/protocol_monitor.rb', line 24

def run_now?
  false
end

#runner_classObject



9
10
11
# File 'lib/legion/extensions/extinction/actors/protocol_monitor.rb', line 9

def runner_class
  self.class
end

#runner_functionObject



13
14
15
# File 'lib/legion/extensions/extinction/actors/protocol_monitor.rb', line 13

def runner_function
  'monitor_protocol'
end

#timeObject



17
18
19
20
21
22
# File 'lib/legion/extensions/extinction/actors/protocol_monitor.rb', line 17

def time
  Legion::Extensions::Extinction::Settings.setting(:monitor_interval)
rescue StandardError => e
  log.debug("monitor_interval setting unavailable: #{e.message}")
  300
end

#use_runner?Boolean

Returns:

  • (Boolean)


28
29
30
# File 'lib/legion/extensions/extinction/actors/protocol_monitor.rb', line 28

def use_runner?
  false
end