Joined June 2012
·
Posted to
Free background jobs on heroku
over 1 year
ago
I actually implemented it. Time will tell if it works for sure. This kills the parent process as well, which on Heroku will bounce your entire dyno (which is what I wanted):
@worker_pid = spawn('bundle exec sidekiq')
t = Thread.new {
Process.wait(@worker_pid)
puts "Worker died. Bouncing unicorn."
Process.kill 'QUIT', Process.pid
}
# Just in case
t.abort_on_exception = true
The idea of using Thread.new { Process.wait() }
comes from the implementation of Process.detach
, which is essentially the same.
Posted to
Free background jobs on heroku
over 1 year
ago
How would you handle if the process dies? Heroku won't notice & bounce your dyno and Unicorn doesn't notice either.
Posted to
Using SASS instead of SCSS by default in Rails
over 1 year
ago
As I said, you add it to config/application.rb
. Is that what you mean?
Achievements
263 Karma
13,311 Total ProTip Views
Walrus
The walrus is no stranger to variety. Use at least 4 different languages throughout all your repos
Forked
Have a project valued enough to be forked by someone else
Charity
Fork and commit to someone's open source project in need
Python
Would you expect anything less? Have at least one original repo where Python is the dominant language
Mongoose 3
Have at least three original repos where Ruby is the dominant language
Mongoose
Have at least one original repo where Ruby is the dominant language
Desert Locust
Have at least one original repo where Erlang is the dominant language
Rails is black magic. That's insane.