Class: SourceMonitor::SourceRetriesController

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

Instance Method Summary collapse

Instance Method Details

#createObject



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

def create
  result = SourceMonitor::Fetching::FetchRunner.enqueue(@source.id, force: true)

  if result == :already_fetching
    render_fetch_enqueue_response(
      "Fetch already in progress for this source. Please wait for the current fetch to complete.",
      toast_level: :warning
    )
  else
    render_fetch_enqueue_response("Retry has been forced and will run shortly.")
  end
rescue StandardError => error
  handle_fetch_failure(error)
end