mirror of
https://github.com/openSUSE/osem.git
synced 2026-08-13 19:54:02 +00:00
Updates puma to 5.6.2 (was 4.3.11)
Also use pumactl to "hot" restart
This commit is contained in:
parent
95964267a0
commit
dffc5c1240
4 changed files with 12 additions and 19 deletions
|
|
@ -19,7 +19,7 @@ set :branch, OSEM_DEPLOY_BRANCH
|
|||
# Shared dirs and files will be symlinked into the app-folder by the 'deploy:link_shared_paths' step.
|
||||
# Some plugins already add folders to shared_dirs like `mina/rails` add `public/assets`, `vendor/bundle` and many more
|
||||
# run `mina -d` to see all folders and files already included in `shared_dirs` and `shared_files`
|
||||
set :shared_dirs, fetch(:shared_dirs, []).push('public/system', '.bundle')
|
||||
set :shared_dirs, fetch(:shared_dirs, []).push('public/system', '.bundle', 'tmp/pids')
|
||||
set :shared_files, fetch(:shared_files, []).push('.env.production')
|
||||
|
||||
desc "Deploys the current version to the server."
|
||||
|
|
@ -36,8 +36,7 @@ task :deploy do
|
|||
|
||||
on :launch do
|
||||
in_path(fetch(:current_path)) do
|
||||
command %{mkdir -p tmp/}
|
||||
command %{touch tmp/restart.txt}
|
||||
command %{bundle exec pumactl restart -e production}
|
||||
command %{sudo systemctl restart osem-dj}
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -4,33 +4,27 @@
|
|||
# the maximum value specified for Puma. Default is set to 5 threads for minimum
|
||||
# and maximum; this matches the default thread size of Active Record.
|
||||
#
|
||||
max_threads_count = ENV.fetch("RAILS_MAX_THREADS") { 5 }
|
||||
min_threads_count = ENV.fetch("RAILS_MIN_THREADS") { max_threads_count }
|
||||
threads min_threads_count, max_threads_count
|
||||
|
||||
# Specifies the `worker_timeout` threshold that Puma will use to wait before
|
||||
# terminating a worker in development environments.
|
||||
#
|
||||
worker_timeout 3600 if ENV.fetch("RAILS_ENV", "development") == "development"
|
||||
threads_count = ENV.fetch('RAILS_MAX_THREADS') { 5 }
|
||||
threads threads_count, threads_count
|
||||
|
||||
# Specifies the `port` that Puma will listen on to receive requests; default is 3000.
|
||||
#
|
||||
port ENV.fetch("PORT") { 3000 }
|
||||
port ENV.fetch('PORT') { 3000 }
|
||||
|
||||
# Specifies the `environment` that Puma will run in.
|
||||
#
|
||||
environment ENV.fetch("RAILS_ENV") { "development" }
|
||||
environment ENV.fetch('RAILS_ENV') { 'development' }
|
||||
|
||||
# Specifies the `pidfile` that Puma will use.
|
||||
pidfile ENV.fetch("PIDFILE") { "tmp/pids/server.pid" }
|
||||
|
||||
# Specifies the number of `workers` to boot in clustered mode.
|
||||
# Workers are forked web server processes. If using threads and workers together
|
||||
# Workers are forked webserver processes. If using threads and workers together
|
||||
# the concurrency of the application would be max `threads` * `workers`.
|
||||
# Workers do not work on JRuby or Windows (both of which do not support
|
||||
# processes).
|
||||
#
|
||||
workers ENV.fetch("WEB_CONCURRENCY") { 2 }
|
||||
workers ENV.fetch('WEB_CONCURRENCY') { 2 }
|
||||
|
||||
# Use the `preload_app!` method when specifying a `workers` number.
|
||||
# This directive tells Puma to first boot the application and load code
|
||||
|
|
@ -40,4 +34,4 @@ workers ENV.fetch("WEB_CONCURRENCY") { 2 }
|
|||
preload_app!
|
||||
|
||||
# Allow puma to be restarted by `rails restart` command.
|
||||
plugin :tmp_restart
|
||||
plugin 'tmp_restart'
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue