I've tried pry and remote-pry, but no luck. I'm familiar with logging, but I want to be able to step thru my code and look at variables.
Does anyone know of anything I can use to debug Sidekiq?
I've tried pry and remote-pry, but no luck. I'm familiar with logging, but I want to be able to step thru my code and look at variables.
Does anyone know of anything I can use to debug Sidekiq?
The best thing I've come up with is this gem gem 'pry-remote'
it works great and stops all processes from running. And it works like pry
just put in binding.remote_pry
and you've got a stopping point.
Workers are designed to be trivial to run. Put pry in your worker code and run it in the rails console.
> MyWorker.new.perform(some_args)
The best thing I've come up with is this gem gem 'pry-remote'
it works great and stops all processes from running. And it works like pry
just put in binding.remote_pry
and you've got a stopping point.
You can use byebug but you have to require it inside the class definition of the job. For instance,
class SomeJob < ActiveJob::Base
require 'byebug'
def perform(*args)
byebug
end
end
then in your rails console run
SomeJob.perform_now(*args)
This will cause a breakpoint to appear where ever you have byebug called with your typical byebug prompt inside your rails console.
© 2022 - 2024 — McMap. All rights reserved.