From 97dfe97d5b8eb2685df52e35f4055caf4bbefabb Mon Sep 17 00:00:00 2001 From: Sam Date: Thu, 10 Oct 2013 14:22:59 +1100 Subject: [PATCH] work around startup issue --- config/unicorn.sample.conf.rb | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/config/unicorn.sample.conf.rb b/config/unicorn.sample.conf.rb index 5ae942a04..a976adcb2 100644 --- a/config/unicorn.sample.conf.rb +++ b/config/unicorn.sample.conf.rb @@ -42,8 +42,13 @@ before_fork do |server, worker| # get rid of rubbish so we don't share it GC.start - require 'demon/sidekiq' - Demon::Sidekiq.start(1) + Thread.new do + # sleep a bit, on startup unicorn kills all its children + # so sidestep it + sleep 10 + require 'demon/sidekiq' + Demon::Sidekiq.start(1) + end end ActiveRecord::Base.connection.disconnect!