Skip to content

Commit cde11c6

Browse files
committed
AP-623: implement puma-plugin-delayed_stop
1 parent f94963b commit cde11c6

5 files changed

Lines changed: 12 additions & 2 deletions

File tree

.ruby-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
3.3.10
1+
3.3.11

Gemfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ gem 'okcomputer', '~> 1.19'
1717
gem 'omniauth-cas', '~> 3.0'
1818
gem 'omniauth-rails_csrf_protection', '~> 1.0'
1919
gem 'puma', '~> 5.3', '>= 5.3.1'
20+
gem 'puma-plugin-delayed_stop', '~> 0.1.2'
2021
gem 'rails', '~> 8.0.4'
2122
gem 'rest-client', '~> 2.1'
2223
gem 'sassc-rails', '~> 2.1'

Gemfile.lock

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,8 @@ GEM
240240
public_suffix (7.0.0)
241241
puma (5.6.7)
242242
nio4r (~> 2.0)
243+
puma-plugin-delayed_stop (0.1.2)
244+
puma (>= 5.0, < 8)
243245
racc (1.8.1)
244246
rack (2.2.21)
245247
rack-protection (3.2.0)
@@ -445,6 +447,7 @@ DEPENDENCIES
445447
omniauth-cas (~> 3.0)
446448
omniauth-rails_csrf_protection (~> 1.0)
447449
puma (~> 5.3, >= 5.3.1)
450+
puma-plugin-delayed_stop (~> 0.1.2)
448451
rails (~> 8.0.4)
449452
rest-client (~> 2.1)
450453
rspec (~> 3.10)
@@ -465,7 +468,7 @@ DEPENDENCIES
465468
webmock
466469

467470
RUBY VERSION
468-
ruby 3.3.10p183
471+
ruby 3.3.11p205
469472

470473
BUNDLED WITH
471474
2.5.22

config/puma.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,9 @@
3434
# process behavior so workers use less memory.
3535
preload_app!
3636

37+
# enable the delayed_stop plugin to intercept signals
38+
plugin :delayed_stop
39+
3740
# Allow puma to be restarted by `rails restart` command.
3841
plugin :tmp_restart
3942

docker-compose.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ services:
33
build: .
44
environment:
55
- LIT_SHOW_HOMEPAGE=1
6+
- PUMA_DELAYED_STOP_DRAIN_SECONDS=1
67
- RAILS_ENV=development
78
- RAILS_SERVE_STATIC_FILES=true
89
- SECRET_KEY_BASE=foobar
@@ -15,3 +16,5 @@ services:
1516
- ./:/opt/app
1617
tty: true
1718
stdin_open: true
19+
stop_grace_period: 30s
20+
stop_signal: SIGQUIT

0 commit comments

Comments
 (0)