Sha256: 7b80faa363b7abaf4a2e7177e44a1a6358b54f07e5c90f0b3faeef4cfc555cdc

Contents?: true

Size: 649 Bytes

Versions: 2

Compression:

Stored size: 649 Bytes

Contents

module MissionControl::Jobs::FailedJobsBulkOperations
  extend ActiveSupport::Concern

  MAX_NUMBER_OF_JOBS_FOR_BULK_OPERATIONS = 3000

  included do
    include MissionControl::Jobs::JobFilters
  end

  private
    # We set a hard limit to prevent problems with the data store (for example, overloading Redis
    # or causing replication lag in MySQL). This should be enough for most scenarios. For
    # cases where we need to retry a huge sets of jobs, we offer a runbook that uses the API.
    def bulk_limited_filtered_failed_jobs
      ApplicationJob.jobs.failed.where(**@job_filters).limit(MAX_NUMBER_OF_JOBS_FOR_BULK_OPERATIONS)
    end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
mission_control-jobs-0.1.1 app/controllers/concerns/mission_control/jobs/failed_jobs_bulk_operations.rb
mission_control-jobs-0.1.0 app/controllers/concerns/mission_control/jobs/failed_jobs_bulk_operations.rb