Skip to content

Commit

Permalink
Add missing foreign_key for supervisor <-> forks association, needed …
Browse files Browse the repository at this point in the history
…in Rails < 7.1

Thanks to @lewispb for spotting the error in Sentry.
  • Loading branch information
rosa committed Nov 6, 2023
1 parent 2843b16 commit 2b86b44
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 2 deletions.
2 changes: 1 addition & 1 deletion app/models/solid_queue/process.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ class SolidQueue::Process < SolidQueue::Record
include Prunable

belongs_to :supervisor, class_name: "SolidQueue::Process", optional: true, inverse_of: :forks
has_many :forks, class_name: "SolidQueue::Process", inverse_of: :supervisor, dependent: :destroy
has_many :forks, class_name: "SolidQueue::Process", inverse_of: :supervisor, foreign_key: :supervisor_id, dependent: :destroy
has_many :claimed_executions

store :metadata, accessors: [ :kind, :pid ], coder: JSON
Expand Down
1 change: 0 additions & 1 deletion test/integration/processes_lifecycle_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@ class ProcessLifecycleTest < ActiveSupport::TestCase
# Workers were shutdown without a chance to terminate orderly, but
# since they're linked to the supervisor, the supervisor deregistering
# also deregistered them and released claimed jobs
# Processes didn't have a chance to deregister either
assert_clean_termination
end

Expand Down

0 comments on commit 2b86b44

Please sign in to comment.