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
11
11
12
12
class << self
13
13
def current_batch_id
14
- Thread . current [ :current_batch_id ]
14
+ ActiveSupport :: IsolatedExecutionState [ :current_batch_id ]
15
15
end
16
16
17
17
def enqueue ( attributes = { } )
@@ -20,13 +20,13 @@ def enqueue(attributes = {})
20
20
job_batch = nil
21
21
transaction do
22
22
job_batch = create! ( batch_attributes ( attributes ) )
23
- Thread . current [ :current_batch_id ] = job_batch . id
23
+ ActiveSupport :: IsolatedExecutionState [ :current_batch_id ] = job_batch . id
24
24
yield
25
25
end
26
26
27
27
job_batch
28
28
ensure
29
- Thread . current [ :current_batch_id ] = previous_batch_id
29
+ ActiveSupport :: IsolatedExecutionState [ :current_batch_id ] = previous_batch_id
30
30
end
31
31
32
32
def dispatch_finished_batches
You can’t perform that action at this time.
0 commit comments