diff --git a/.ruby-version b/.ruby-version index 5f6fc5e..b9b3b0d 100644 --- a/.ruby-version +++ b/.ruby-version @@ -1 +1 @@ -3.3.10 +3.3.11 diff --git a/Gemfile b/Gemfile index 9e5659d..eee18d0 100644 --- a/Gemfile +++ b/Gemfile @@ -17,6 +17,7 @@ gem 'okcomputer', '~> 1.19' gem 'omniauth-cas', '~> 3.0' gem 'omniauth-rails_csrf_protection', '~> 1.0' gem 'puma', '~> 5.3', '>= 5.3.1' +gem 'puma-plugin-delayed_stop', '~> 0.1.2' gem 'rails', '~> 8.0.4' gem 'rest-client', '~> 2.1' gem 'sassc-rails', '~> 2.1' diff --git a/Gemfile.lock b/Gemfile.lock index aa8cf53..c43ff61 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -240,6 +240,8 @@ GEM public_suffix (7.0.0) puma (5.6.7) nio4r (~> 2.0) + puma-plugin-delayed_stop (0.1.2) + puma (>= 5.0, < 8) racc (1.8.1) rack (2.2.21) rack-protection (3.2.0) @@ -445,6 +447,7 @@ DEPENDENCIES omniauth-cas (~> 3.0) omniauth-rails_csrf_protection (~> 1.0) puma (~> 5.3, >= 5.3.1) + puma-plugin-delayed_stop (~> 0.1.2) rails (~> 8.0.4) rest-client (~> 2.1) rspec (~> 3.10) @@ -465,7 +468,7 @@ DEPENDENCIES webmock RUBY VERSION - ruby 3.3.10p183 + ruby 3.3.11p205 BUNDLED WITH 2.5.22 diff --git a/config/puma.rb b/config/puma.rb index f5919d3..e6c6c5d 100644 --- a/config/puma.rb +++ b/config/puma.rb @@ -34,6 +34,9 @@ # process behavior so workers use less memory. preload_app! +# enable the delayed_stop plugin to intercept signals +plugin :delayed_stop + # Allow puma to be restarted by `rails restart` command. plugin :tmp_restart diff --git a/docker-compose.yml b/docker-compose.yml index 5d38b69..4793b2d 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -3,6 +3,7 @@ services: build: . environment: - LIT_SHOW_HOMEPAGE=1 + - PUMA_DELAYED_STOP_DRAIN_SECONDS=1 - RAILS_ENV=development - RAILS_SERVE_STATIC_FILES=true - SECRET_KEY_BASE=foobar @@ -15,3 +16,5 @@ services: - ./:/opt/app tty: true stdin_open: true + stop_grace_period: 30s + stop_signal: SIGQUIT