Class: SourceMonitor::SourceHealthResetsController

Inherits:
ApplicationController show all
Includes:
SetSource, SourceTurboResponses
Defined in:
app/controllers/source_monitor/source_health_resets_controller.rb

Instance Method Summary collapse

Instance Method Details

#createObject



10
11
12
13
14
15
16
17
18
19
20
# File 'app/controllers/source_monitor/source_health_resets_controller.rb', line 10

def create
  SourceMonitor::Health::SourceHealthReset.call(source: @source)
  SourceMonitor::Realtime.broadcast_source(@source)

  render_fetch_enqueue_response(
    "Health state reset",
    toast_level: :success
  )
rescue StandardError => error
  handle_fetch_failure(error, prefix: "Health reset")
end