spawning another process inside the unicorn server

jamesperet 9 years ago
parent
commit
d1fe9cab7f
2 changed files with 2 additions and 2 deletions
  1. 1 2
      Procfile
  2. 1 0
      config/unicorn.rb

+ 1 - 2
Procfile

@@ -1,2 +1 @@
1
-web: bundle exec unicorn -p $PORT -c ./config/unicorn.rb
2
-resque: env TERM_CHILD=1 RESQUE_TERM_TIMEOUT=10 bundle exec rake resque:work
1
+web: bundle exec unicorn -p $PORT -c ./config/unicorn.rb

+ 1 - 0
config/unicorn.rb

@@ -29,6 +29,7 @@ after_fork do |server, worker|
29 29
   # If you are using Redis but not Resque, change this
30 30
   if defined?(Resque)
31 31
     Resque.redis = REDIS_WORKER
32
+    @resque_pid ||= spawn("bundle exec rake resque:work")
32 33
     Rails.logger.info('Connected to Redis')
33 34
   end
34 35
 end