add whacamole configuration [fixes SCI-1683]

This commit is contained in:
zmagod 2017-10-25 09:47:26 +02:00
parent 8cda449738
commit 4de335d189
4 changed files with 18 additions and 0 deletions

View file

@ -88,6 +88,7 @@ end
group :production do
gem 'puma'
gem 'rails_12factor'
gem 'whacamole'
end
group :test do

View file

@ -339,6 +339,7 @@ GEM
unicode-display_width (1.2.1)
warden (1.2.6)
rack (>= 1.0)
whacamole (1.2.0)
wicked_pdf (1.0.3)
wkhtmltopdf-heroku (2.12.3.0)
yomu (0.2.4)
@ -421,6 +422,7 @@ DEPENDENCIES
tzinfo-data
uglifier (>= 1.3.0)
underscore-rails
whacamole
wicked_pdf
wkhtmltopdf-heroku
yomu

View file

@ -1,2 +1,3 @@
web: bundle exec puma -C config/puma.rb
worker: bundle exec rake jobs:work
whacamole: bundle exec whacamole -c ./config/whacamole.rb

14
config/whacamole.rb Normal file
View file

@ -0,0 +1,14 @@
# https://github.com/arches/whacamole
#
# Steps to setup this on your heroku instance, this will affect only the worker
#
# 1) set the env variables (api token: > heroku auth:token)
# 2) > heroku labs:enable log-runtime-metrics --app YOUR_APP_NAME
# 3) > heroku ps:scale whacamole=1 --app YOUR_APP_NAME
Whacamole.configure(ENV['HEROKU_APP_NAME']) do |config|
config.api_token = ENV['HEROKU_API_TOKEN']
config.dynos = %w{worker}
config.restart_threshold = ENV['WHACAMOLE_DYNO_RESTART_THRESHOLD'].to_i
config.restart_window = ENV['WHACAMOLE_DYNO_RESTART_TIME_IN_SEC'].to_i
end