Updates puma to 5.6.2 (was 4.3.11)

Also use pumactl to "hot" restart
This commit is contained in:
Henne Vogelsang 2022-03-03 17:19:42 +01:00
parent 95964267a0
commit dffc5c1240
No known key found for this signature in database
GPG key ID: 97DDB66BDAF8D4D6
4 changed files with 12 additions and 19 deletions

View file

@ -20,7 +20,7 @@ else
end
# Use Puma as the app server
gem 'puma', '~> 4.3'
gem 'puma'
# respond_to methods have been extracted to the responders gem
# http://edgeguides.rubyonrails.org/upgrading_ruby_on_rails.html#responders

View file

@ -415,7 +415,7 @@ GEM
prawn-table (0.2.2)
prawn (>= 1.3.0, < 3.0.0)
public_suffix (4.0.6)
puma (4.3.11)
puma (5.6.2)
nio4r (~> 2.0)
racc (1.6.0)
rack (2.2.3)
@ -695,7 +695,7 @@ DEPENDENCIES
pg
prawn-qrcode
prawn-rails
puma (~> 4.3)
puma
rails (~> 7.0)
rails-assets-bootstrap-markdown!
rails-assets-bootstrap-select!

View file

@ -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

View file

@ -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'