Commit 8d1a89b4 authored by jz143's avatar jz143

use god (a package) to start/monitor worker processes

parent bda51834
...@@ -81,4 +81,7 @@ gem "omniauth-duke-oauth2", :git => 'http://gitlab.oit.duke.edu/colab/omniauth-d ...@@ -81,4 +81,7 @@ gem "omniauth-duke-oauth2", :git => 'http://gitlab.oit.duke.edu/colab/omniauth-d
# job queue # job queue
gem 'resque', '~> 1.26.0' gem 'resque', '~> 1.26.0'
# process monitor for background workers, etc.
gem 'god', '~> 0.13.7'
gem 'bootstrap-sass', '~> 3.3.5' gem 'bootstrap-sass', '~> 3.3.5'
...@@ -106,6 +106,7 @@ GEM ...@@ -106,6 +106,7 @@ GEM
multipart-post (>= 1.2, < 3) multipart-post (>= 1.2, < 3)
globalid (0.3.6) globalid (0.3.6)
activesupport (>= 4.1.0) activesupport (>= 4.1.0)
god (0.13.7)
hashie (3.4.3) hashie (3.4.3)
i18n (0.7.0) i18n (0.7.0)
jbuilder (2.3.1) jbuilder (2.3.1)
...@@ -261,6 +262,7 @@ DEPENDENCIES ...@@ -261,6 +262,7 @@ DEPENDENCIES
capistrano3-puma capistrano3-puma
coffee-rails (~> 4.1.0) coffee-rails (~> 4.1.0)
config (~> 1.0.0) config (~> 1.0.0)
god (~> 0.13.7)
jbuilder (~> 2.0) jbuilder (~> 2.0)
jquery-rails jquery-rails
mysql2 (~> 0.3.18) mysql2 (~> 0.3.18)
......
#!/bin/bash
export VERBOSE=1
export QUEUE=mac_online
rake environment resque:work
#!/bin/bash
export VERBOSE=1
export QUEUE=web_background
rake environment resque:work
God.watch do |w|
w.name = "mac_worker"
unless ENV['APPSTORE_RAILS_ROOT'].nil?
w.dir = ENV['APPSTORE_RAILS_ROOT']
else
w.dir = '/Users/appstore/appstore_sign'
end
w.env = { 'VERBOSE' => '1',
'QUEUE' => 'mac_online' }
w.start = "bash -l -c 'rake environment resque:work'"
w.keepalive
end
God.watch do |w|
w.name = "web_worker"
unless ENV['APPSTORE_RAILS_ROOT'].nil?
w.dir = ENV['APPSTORE_RAILS_ROOT']
else
w.dir = '/home/appstore/appstore/current'
end
w.env = { 'VERBOSE' => '1',
'QUEUE' => 'web_background' }
w.start = "bash -l -c 'rake environment resque:work'"
w.keepalive
end
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment