Class: GroundControl::Api::BulkRetriesController

Inherits:
ApplicationController show all
Defined in:
app/controllers/ground_control/api/bulk_retries_controller.rb

Instance Method Summary collapse

Instance Method Details

#createObject



6
7
8
9
10
11
12
# File 'app/controllers/ground_control/api/bulk_retries_controller.rb', line 6

def create
  jobs = ActiveJob.jobs.where(**@job_filters).failed
  count = [jobs.count, 3000].min
  jobs.limit(3000).retry_all

  render json: { message: "Retried #{count} jobs" }
end