Commit 6ce54084 authored by Grzegorz Bizon's avatar Grzegorz Bizon

Merge branch '490-enable-puma-by-default-in-GDK' into 'master'

Enable puma by default in GDK

Closes gitlab-development-kit#490

See merge request gitlab-org/gitlab-ce!30285
parents 04bcbaa5 b7ea4bd8
#!/bin/sh #!/bin/sh
set -e
cd $(dirname $0)/.. cd $(dirname $0)/..
app_root=$(pwd) app_root=$(pwd)
# Switch to experimental PUMA configuration case "$USE_WEB_SERVER" in
if [ -n "${EXPERIMENTAL_PUMA}" ]; then puma|"") # and the "" defines default
exec bin/web_puma "$@" exec bin/web_puma "$@"
fi ;;
unicorn_pidfile="$app_root/tmp/pids/unicorn.pid"
unicorn_config="$app_root/config/unicorn.rb"
unicorn_cmd="bundle exec unicorn_rails -c $unicorn_config -E $RAILS_ENV"
get_unicorn_pid()
{
local pid=$(cat $unicorn_pidfile)
if [ -z "$pid" ] ; then
echo "Could not find a PID in $unicorn_pidfile"
exit 1
fi
unicorn_pid=$pid
}
start()
{
exec $unicorn_cmd -D
}
start_foreground()
{
exec $unicorn_cmd
}
stop()
{
get_unicorn_pid
kill -QUIT $unicorn_pid
}
reload() unicorn)
{ exec bin/web_unicorn "$@"
get_unicorn_pid ;;
kill -USR2 $unicorn_pid
}
case "$1" in *)
start) echo "Unkown web server used by USE_WEB_SERVER: $USE_WEB_SERVER."
start exit 1
;; ;;
start_foreground)
start_foreground
;;
stop)
stop
;;
reload)
reload
;;
*)
echo "Usage: RAILS_ENV=your_env $0 {start|stop|reload}"
;;
esac esac
#!/bin/sh
cd $(dirname $0)/..
app_root=$(pwd)
unicorn_pidfile="$app_root/tmp/pids/unicorn.pid"
unicorn_config="$app_root/config/unicorn.rb"
unicorn_cmd="bundle exec unicorn_rails -c $unicorn_config -E $RAILS_ENV"
get_unicorn_pid()
{
local pid=$(cat $unicorn_pidfile)
if [ -z "$pid" ] ; then
echo "Could not find a PID in $unicorn_pidfile"
exit 1
fi
unicorn_pid=$pid
}
start()
{
exec $unicorn_cmd -D
}
start_foreground()
{
exec $unicorn_cmd
}
stop()
{
get_unicorn_pid
kill -QUIT $unicorn_pid
}
reload()
{
get_unicorn_pid
kill -USR2 $unicorn_pid
}
case "$1" in
start)
start
;;
start_foreground)
start_foreground
;;
stop)
stop
;;
reload)
reload
;;
*)
echo "Usage: RAILS_ENV=your_env $0 {start|stop|reload}"
;;
esac
...@@ -14,8 +14,8 @@ if defined?(::Puma) && !Rails.env.test? ...@@ -14,8 +14,8 @@ if defined?(::Puma) && !Rails.env.test?
Gitlab::Application.configure do |config| Gitlab::Application.configure do |config|
config.middleware.insert_before(Rack::Runtime, Rack::Timeout, config.middleware.insert_before(Rack::Runtime, Rack::Timeout,
service_timeout: 60, service_timeout: ENV.fetch('GITLAB_RAILS_RACK_TIMEOUT', 60).to_i,
wait_timeout: 90) wait_timeout: ENV.fetch('GITLAB_RAILS_WAIT_TIMEOUT', 90).to_i)
end end
observer = Gitlab::Cluster::RackTimeoutObserver.new observer = Gitlab::Cluster::RackTimeoutObserver.new
......
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