Skip to content

Commit

Permalink
fix: Ensure DataExports::CombinePartsJob uniqueness (#2777)
Browse files Browse the repository at this point in the history
This should fix a race condition when multiple data export parts are
finished very close in time resulting into multiple CombinePartsJob
queued, hence active storage fails because of duplicated key.
  • Loading branch information
ancorcruz authored Nov 5, 2024
1 parent 2734962 commit 4617b49
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions app/jobs/data_exports/combine_parts_job.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ module DataExports
class CombinePartsJob < ApplicationJob
queue_as :default

unique :until_executed, on_conflict: :log

def perform(data_export)
CombinePartsService.call(data_export:).raise_if_error!
end
Expand Down

0 comments on commit 4617b49

Please sign in to comment.