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
2
Gemfile
2
Gemfile
|
|
@ -20,7 +20,7 @@ else
|
||||||
end
|
end
|
||||||
|
|
||||||
# Use Puma as the app server
|
# Use Puma as the app server
|
||||||
gem 'puma', '~> 4.3'
|
gem 'puma'
|
||||||
|
|
||||||
# respond_to methods have been extracted to the responders gem
|
# respond_to methods have been extracted to the responders gem
|
||||||
# http://edgeguides.rubyonrails.org/upgrading_ruby_on_rails.html#responders
|
# http://edgeguides.rubyonrails.org/upgrading_ruby_on_rails.html#responders
|
||||||
|
|
|
||||||
|
|
@ -415,7 +415,7 @@ GEM
|
||||||
prawn-table (0.2.2)
|
prawn-table (0.2.2)
|
||||||
prawn (>= 1.3.0, < 3.0.0)
|
prawn (>= 1.3.0, < 3.0.0)
|
||||||
public_suffix (4.0.6)
|
public_suffix (4.0.6)
|
||||||
puma (4.3.11)
|
puma (5.6.2)
|
||||||
nio4r (~> 2.0)
|
nio4r (~> 2.0)
|
||||||
racc (1.6.0)
|
racc (1.6.0)
|
||||||
rack (2.2.3)
|
rack (2.2.3)
|
||||||
|
|
@ -695,7 +695,7 @@ DEPENDENCIES
|
||||||
pg
|
pg
|
||||||
prawn-qrcode
|
prawn-qrcode
|
||||||
prawn-rails
|
prawn-rails
|
||||||
puma (~> 4.3)
|
puma
|
||||||
rails (~> 7.0)
|
rails (~> 7.0)
|
||||||
rails-assets-bootstrap-markdown!
|
rails-assets-bootstrap-markdown!
|
||||||
rails-assets-bootstrap-select!
|
rails-assets-bootstrap-select!
|
||||||
|
|
|
||||||
|
|
@ -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.
|
# 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
|
# 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`
|
# 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')
|
set :shared_files, fetch(:shared_files, []).push('.env.production')
|
||||||
|
|
||||||
desc "Deploys the current version to the server."
|
desc "Deploys the current version to the server."
|
||||||
|
|
@ -36,8 +36,7 @@ task :deploy do
|
||||||
|
|
||||||
on :launch do
|
on :launch do
|
||||||
in_path(fetch(:current_path)) do
|
in_path(fetch(:current_path)) do
|
||||||
command %{mkdir -p tmp/}
|
command %{bundle exec pumactl restart -e production}
|
||||||
command %{touch tmp/restart.txt}
|
|
||||||
command %{sudo systemctl restart osem-dj}
|
command %{sudo systemctl restart osem-dj}
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -4,33 +4,27 @@
|
||||||
# the maximum value specified for Puma. Default is set to 5 threads for minimum
|
# 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.
|
# and maximum; this matches the default thread size of Active Record.
|
||||||
#
|
#
|
||||||
max_threads_count = ENV.fetch("RAILS_MAX_THREADS") { 5 }
|
threads_count = ENV.fetch('RAILS_MAX_THREADS') { 5 }
|
||||||
min_threads_count = ENV.fetch("RAILS_MIN_THREADS") { max_threads_count }
|
threads threads_count, 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"
|
|
||||||
|
|
||||||
# Specifies the `port` that Puma will listen on to receive requests; default is 3000.
|
# 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.
|
# 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.
|
# Specifies the `pidfile` that Puma will use.
|
||||||
pidfile ENV.fetch("PIDFILE") { "tmp/pids/server.pid" }
|
pidfile ENV.fetch("PIDFILE") { "tmp/pids/server.pid" }
|
||||||
|
|
||||||
# Specifies the number of `workers` to boot in clustered mode.
|
# 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`.
|
# the concurrency of the application would be max `threads` * `workers`.
|
||||||
# Workers do not work on JRuby or Windows (both of which do not support
|
# Workers do not work on JRuby or Windows (both of which do not support
|
||||||
# processes).
|
# processes).
|
||||||
#
|
#
|
||||||
workers ENV.fetch("WEB_CONCURRENCY") { 2 }
|
workers ENV.fetch('WEB_CONCURRENCY') { 2 }
|
||||||
|
|
||||||
# Use the `preload_app!` method when specifying a `workers` number.
|
# Use the `preload_app!` method when specifying a `workers` number.
|
||||||
# This directive tells Puma to first boot the application and load code
|
# This directive tells Puma to first boot the application and load code
|
||||||
|
|
@ -40,4 +34,4 @@ workers ENV.fetch("WEB_CONCURRENCY") { 2 }
|
||||||
preload_app!
|
preload_app!
|
||||||
|
|
||||||
# Allow puma to be restarted by `rails restart` command.
|
# 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