Class: Kitsune::Kit::Workflows::Doctor
- Defined in:
- lib/kitsune/kit/workflows/doctor.rb
Constant Summary collapse
- SUPPORTED_UBUNTU =
%w[22.04 24.04].freeze
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(config:, provider:, state_store:, transport_factory: nil, operations: [], event_bus: Events::NullBus.new, clock: Clock.new) ⇒ Doctor
constructor
A new instance of Doctor.
Constructor Details
#initialize(config:, provider:, state_store:, transport_factory: nil, operations: [], event_bus: Events::NullBus.new, clock: Clock.new) ⇒ Doctor
Returns a new instance of Doctor.
17 18 19 20 21 22 23 24 |
# File 'lib/kitsune/kit/workflows/doctor.rb', line 17 def initialize(config:, provider:, state_store:, transport_factory: nil, operations: [], event_bus: Events::NullBus.new, clock: Clock.new) super(config: config, event_bus: event_bus, clock: clock) @provider = provider @state_store = state_store @transport_factory = transport_factory @operations = operations end |
Instance Method Details
#call ⇒ Object
26 27 28 29 30 31 32 33 34 |
# File 'lib/kitsune/kit/workflows/doctor.rb', line 26 def call started_at = monotonic_time emit("run_started", command: "doctor", environment: config.environment) checks = local_checks + infrastructure_checks emit_findings(checks) status = checks.any? { |check| check.status == "fail" } ? "failure" : "success" emit("run_finished", status: status, duration_ms: elapsed_ms(started_at)) Result.new(status: status.to_sym, value: checks, metadata: { run_id: run_id }) end |