File tree Expand file tree Collapse file tree 1 file changed +17
-3
lines changed Expand file tree Collapse file tree 1 file changed +17
-3
lines changed Original file line number Diff line number Diff line change @@ -189,15 +189,29 @@ def error(progname = nil, &block)
189
189
end
190
190
191
191
def log_enqueue_source
192
- source = extract_enqueue_source_location ( caller )
192
+ source = enqueue_source_location
193
193
194
194
if source
195
195
logger . info ( "↳ #{ source } " )
196
196
end
197
197
end
198
198
199
- def extract_enqueue_source_location ( locations )
200
- backtrace_cleaner . clean ( locations . lazy ) . first
199
+ if Thread . respond_to? ( :each_caller_location )
200
+ def enqueue_source_location
201
+ Thread . each_caller_location do |location |
202
+ frame = backtrace_cleaner . clean_frame ( location )
203
+ return frame if frame
204
+ end
205
+ nil
206
+ end
207
+ else
208
+ def enqueue_source_location
209
+ caller_locations ( 2 ) . each do |location |
210
+ frame = backtrace_cleaner . clean_frame ( location )
211
+ return frame if frame
212
+ end
213
+ nil
214
+ end
201
215
end
202
216
203
217
def enqueued_jobs_message ( adapter , enqueued_jobs )
You can’t perform that action at this time.
0 commit comments