Commit 3220ae83 by Robert Raposa Committed by GitHub

Merge pull request #3689 from edx/max/forums-block-on-validate

Sleep before attempting to restart forums
parents c80bb060 6003f598
......@@ -40,6 +40,10 @@ FORUM_LISTEN_HOST: "0.0.0.0"
FORUM_LISTEN_PORT: "4567"
FORUM_USE_TCP: false
# If forums fails to start because rake search:validate_index failed,
# wait this long before attempting to restart it
FORUM_RESTART_DELAY: 60
forum_environment:
RBENV_ROOT: "{{ forum_rbenv_root }}"
GEM_HOME: "{{ forum_gem_root }}"
......
......@@ -6,7 +6,13 @@ cd {{ forum_code_dir }}
{% if devstack %}
{{ forum_rbenv_shims }}/ruby app.rb
{% elif FORUM_USE_TCP %}
{{ forum_binstubs_dir }}/unicorn -c config/unicorn_tcp.rb
{{ forum_binstubs_dir }}/unicorn -c config/unicorn_tcp.rb -I '.'
{% else %}
{{ forum_binstubs_dir }}/unicorn -c config/unicorn.rb
{{ forum_binstubs_dir }}/unicorn -c config/unicorn.rb -I '.'
{% endif %}
# If forums fails to start because elasticsearch isn't migrated, sleep so supervisord
# doesn't attempt to restart it immediately.
# 101 is the magic exit code forums uses to mean "rake search:validate_index failed"
exit_code="$?"
[ "$exit_code" -eq 101 ] && sleep {{ FORUM_RESTART_DELAY }} && exit "$exit_code"
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