Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
16 changes: 8 additions & 8 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ GEM
coderay (1.1.3)
coercible (1.0.0)
descendants_tracker (~> 0.0.1)
concurrent-ruby (1.1.10)
concurrent-ruby (1.2.0)
connection_pool (2.2.5)
cose (1.3.0)
cbor (~> 0.5.9)
Expand Down Expand Up @@ -287,15 +287,15 @@ GEM
rake
formatador (0.2.5)
foundation_emails (2.2.1.0)
fugit (1.8.0)
fugit (1.8.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.1)
globalid (1.1.0)
activesupport (>= 5.0)
good_job (3.7.2)
good_job (3.12.3)
activejob (>= 6.0.0)
activerecord (>= 6.0.0)
concurrent-ruby (>= 1.0.2)
Expand Down Expand Up @@ -412,7 +412,7 @@ GEM
net-ssh (6.1.0)
newrelic_rpm (8.15.0)
nio4r (2.5.8)
nokogiri (1.14.0)
nokogiri (1.14.2)
mini_portile2 (~> 2.8.0)
racc (~> 1.4)
notiffany (0.1.3)
Expand Down Expand Up @@ -502,7 +502,7 @@ GEM
activesupport (>= 4.2)
choice (~> 0.2.0)
ruby-graphviz (~> 1.2)
rails-html-sanitizer (1.4.4)
rails-html-sanitizer (1.5.0)
loofah (~> 2.19, >= 2.19.1)
rails-i18n (7.0.6)
i18n (>= 0.7, < 2)
Expand Down Expand Up @@ -652,7 +652,7 @@ GEM
bindata (~> 2.4)
openssl (> 2.0, < 3.1)
openssl-signature_algorithm (~> 1.0)
tzinfo (2.0.5)
tzinfo (2.0.6)
concurrent-ruby (~> 1.0)
uglifier (4.2.0)
execjs (>= 0.3.0, < 3)
Expand Down Expand Up @@ -710,7 +710,7 @@ GEM
nokogiri (~> 1.8)
yard (0.9.28)
webrick (~> 1.7.0)
zeitwerk (2.6.6)
zeitwerk (2.6.7)
zonebie (0.6.1)
zxcvbn (0.1.9)

Expand Down
1 change: 1 addition & 0 deletions config/application.rb
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ class Application < Rails::Application
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.enable_listen_notify = false
config.good_job.queue_select_limit = IdentityConfig.store.good_job_queue_select_limit
# see config/initializers/job_configurations.rb for cron schedule

Expand Down
36 changes: 36 additions & 0 deletions db/worker_jobs_migrate/20230221201647_create_good_job_batches.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# frozen_string_literal: true
class CreateGoodJobBatches < ActiveRecord::Migration[7.0]
def change
reversible do |dir|
dir.up do
# Ensure this incremental update migration is idempotent
# with monolithic install migration.
return if connection.table_exists?(:good_job_batches)
end
end

create_table :good_job_batches, id: :uuid do |t|
t.timestamps
t.text :description
t.jsonb :serialized_properties
t.text :on_finish
t.text :on_success
t.text :on_discard
t.text :callback_queue_name
t.integer :callback_priority
t.datetime :enqueued_at
t.datetime :discarded_at
t.datetime :finished_at
end

safety_assured do
change_table :good_jobs do |t|
t.uuid :batch_id
t.uuid :batch_callback_id

t.index :batch_id, where: "batch_id IS NOT NULL"
t.index :batch_callback_id, where: "batch_callback_id IS NOT NULL"
end
end
end
end
21 changes: 20 additions & 1 deletion db/worker_jobs_schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,26 @@
#
# It's strongly recommended that you check this file into your version control system.

ActiveRecord::Schema[7.0].define(version: 2022_10_24_144708) do
ActiveRecord::Schema[7.0].define(version: 2023_02_21_201647) do
# These are extensions that must be enabled in order to support this database
enable_extension "pgcrypto"
enable_extension "plpgsql"

create_table "good_job_batches", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t|
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.text "description"
t.jsonb "serialized_properties"
t.text "on_finish"
t.text "on_success"
t.text "on_discard"
t.text "callback_queue_name"
t.integer "callback_priority"
t.datetime "enqueued_at"
t.datetime "discarded_at"
t.datetime "finished_at"
end

create_table "good_job_processes", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t|
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
Expand Down Expand Up @@ -44,8 +59,12 @@
t.text "cron_key"
t.uuid "retried_good_job_id"
t.datetime "cron_at", precision: nil
t.uuid "batch_id"
t.uuid "batch_callback_id"
t.index ["active_job_id", "created_at"], name: "index_good_jobs_on_active_job_id_and_created_at"
t.index ["active_job_id"], name: "index_good_jobs_on_active_job_id"
t.index ["batch_callback_id"], name: "index_good_jobs_on_batch_callback_id", where: "(batch_callback_id IS NOT NULL)"
t.index ["batch_id"], name: "index_good_jobs_on_batch_id", where: "(batch_id IS NOT NULL)"
t.index ["concurrency_key"], name: "index_good_jobs_on_concurrency_key_when_unfinished", where: "(finished_at IS NULL)"
t.index ["cron_key", "created_at"], name: "index_good_jobs_on_cron_key_and_created_at"
t.index ["cron_key", "cron_at"], name: "index_good_jobs_on_cron_key_and_cron_at", unique: true
Expand Down