File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ class JobBatch < Record
1111
1212 class << self
1313 def current_batch_id
14- Thread . current [ :current_batch_id ]
14+ ActiveSupport :: IsolatedExecutionState [ :current_batch_id ]
1515 end
1616
1717 def enqueue ( attributes = { } )
@@ -20,13 +20,13 @@ def enqueue(attributes = {})
2020 job_batch = nil
2121 transaction do
2222 job_batch = create! ( batch_attributes ( attributes ) )
23- Thread . current [ :current_batch_id ] = job_batch . id
23+ ActiveSupport :: IsolatedExecutionState [ :current_batch_id ] = job_batch . id
2424 yield
2525 end
2626
2727 job_batch
2828 ensure
29- Thread . current [ :current_batch_id ] = previous_batch_id
29+ ActiveSupport :: IsolatedExecutionState [ :current_batch_id ] = previous_batch_id
3030 end
3131
3232 def dispatch_finished_batches
You can’t perform that action at this time.
0 commit comments