Unicorn & Pry in Rails

I cannot use pry with Unicorn since I will someday boot from my invitation. Here is a quick overview:

In the user action in the controller, I have the following:

def assign binding.pry end 

Getting to this route is not a problem, and I even get a familiar pry request pry this:

  8: def assign 9: => 10: binding.pry 11: end [1] pry(#<RolesController>)> 

After some time, I get this, which throws me out of the prompt:

 [3] pry(#<RolesController>)> E, [2014-08-21T16:29:01.698472 #4780] ERROR -- : worker=0 PID:4852 timeout (61s > 60s), killing E, [2014-08-21T16:29:01.721420 #4780] ERROR -- : reaped #<Process::Status: pid 4852 SIGKILL (signal 9)> worker=0 I, [2014-08-21T16:29:01.745491 #5109] INFO -- : worker=0 ready 

Is there a way to not kill the process during the search?

+6
source share
2 answers

I was able to fix this by changing the timeout configuration in my config/unicorn.rb as follows:

 if ENV["RAILS_ENV"] == "development" worker_processes 1 timeout 10000 else worker_processes Integer(ENV["WEB_CONCURRENCY"] || 3) timeout 15 preload_app true end 
+11
source

I think that for proper debugging in development, you need to set up a unicorn, not a timeout in dev mode. The unicorn employee is waiting for the response of your controller action that you hit, and therefore, he does not receive a response within the set timeout, the process is killed.

+2
source

Source: https://habr.com/ru/post/974182/


All Articles