Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -308,15 +308,15 @@ GEM
rake
formatador (0.2.5)
foundation_emails (2.2.1.0)
fugit (1.6.0)
fugit (1.7.1)
et-orbi (~> 1, >= 1.2.7)
raabro (~> 1.4)
geocoder (1.7.0)
get_process_mem (0.2.7)
ffi (~> 1.0)
globalid (1.0.0)
activesupport (>= 5.0)
good_job (3.4.4)
good_job (3.6.0)
activejob (>= 6.0.0)
activerecord (>= 6.0.0)
concurrent-ruby (>= 1.0.2)
Expand Down Expand Up @@ -729,7 +729,7 @@ GEM
xpath (3.2.0)
nokogiri (~> 1.8)
yard (0.9.26)
zeitwerk (2.6.0)
zeitwerk (2.6.1)
zonebie (0.6.1)
zxcvbn (0.1.7)

Expand Down
2 changes: 2 additions & 0 deletions config/application.rb
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,8 @@ class Application < Rails::Application
config.good_job.enable_cron = true
config.good_job.max_threads = IdentityConfig.store.good_job_max_threads
config.good_job.queues = IdentityConfig.store.good_job_queues
config.good_job.preserve_job_records = false
config.good_job.queue_select_limit = 5_000
Comment thread
mitchellhenke marked this conversation as resolved.
Outdated
# see config/initializers/job_configurations.rb for cron schedule

includes_star_queue = config.good_job.queues.split(';').any? do |name_threads|
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# frozen_string_literal: true
class CreateIndexGoodJobsJobsOnPriorityCreatedAtWhenUnfinished < ActiveRecord::Migration[7.0]
disable_ddl_transaction!

def change
reversible do |dir|
dir.up do
# Ensure this incremental update migration is idempotent
# with monolithic install migration.
return if connection.index_name_exists?(:good_jobs, :index_good_jobs_jobs_on_priority_created_at_when_unfinished)
end
end

add_index :good_jobs, [:priority, :created_at], order: { priority: "DESC NULLS LAST", created_at: :asc },
where: "finished_at IS NULL", name: :index_good_jobs_jobs_on_priority_created_at_when_unfinished,
algorithm: :concurrently
end
end