Skip to content

Commit 226252e

Browse files
committed
refactoring to support waiting for child services
1 parent 2e25814 commit 226252e

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

templates/gunicorn/gunicorn.conf.erb

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,3 +48,16 @@ exec <% if scope.lookupvar('edx::newrelic::reporting') == true -%>$NEWRELIC run-
4848
<% when 'python' -%>
4949
exec su - www-data -c '<%= scope.lookupvar('virtualenv') %>/bin/python <%= scope.lookupvar('package_root') %>/<%= scope.lookupvar('script_name') %> >/dev/null 1>&1'
5050
<% end -%>
51+
52+
<% if (scope.lookupvar('stacked') == true) && (scope.lookupvar('title') != 'cms') -%>
53+
post-start script
54+
while true
55+
do
56+
if $(curl -s -i localhost:$PORT/heartbeat | egrep -q '200 OK'); then
57+
break;
58+
else
59+
sleep 1;
60+
fi
61+
done
62+
end script
63+
<% end -%>

0 commit comments

Comments
 (0)