简体   繁体   中英

How can I use ruby-debugger inside of a resque job?

我正在寻找一个启动工作进程的命令,以便在作业的perform方法内部可以调用debugger并将控制权扔给命令提示符。

instead of calling Resque.enqueue(Archive, self.id, branch) (from the resque readme), I think you should be able to call Archive.perform(self.id, branch) . Doing this, you should be able to use debugger inside the worker.

将以下行添加到您的Rails应用程序Resque.inline = true,这将导致resque作业不进入队列,而是立即执行

I ended up using pry instead of ruby-debugger. Works like a charm. Practically an Irish charm!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM