Skip to content

Commit 6be415a

Browse files
committed
Adding delayed stop. Elegant shutdown so swarm can properly remove it during shutdown
1 parent 28f57a8 commit 6be415a

3 files changed

Lines changed: 8 additions & 0 deletions

File tree

Gemfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ gem 'berkeley_library-docker', '~> 0.2.0'
1010
gem 'berkeley_library-logging', '~> 0.3.0'
1111
gem 'berkeley_library-marc', '~> 0.3.2'
1212
gem 'berkeley_library-util', '~> 0.3.0'
13+
gem 'puma-plugin-delayed_stop', '~> 0.1.2'
1314
gem 'cssbundling-rails'
1415
gem 'csv'
1516
gem 'dotiw', '~> 5.3.3'

Gemfile.lock

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -287,6 +287,8 @@ GEM
287287
public_suffix (7.0.2)
288288
puma (7.2.0)
289289
nio4r (~> 2.0)
290+
puma-plugin-delayed_stop (0.1.2)
291+
puma (>= 5.0, < 8)
290292
racc (1.8.1)
291293
rack (3.2.5)
292294
rack-protection (4.2.1)
@@ -505,6 +507,7 @@ DEPENDENCIES
505507
pg (~> 1.2)
506508
pg_search (~> 2.3)
507509
puma (~> 7.2)
510+
puma-plugin-delayed_stop (~> 0.1.2)
508511
rails (~> 8.0.4)
509512
rspec (~> 3.10)
510513
rspec-rails (~> 8.0)

config/puma.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,10 @@
3333
# Allow puma to be restarted by `bin/rails restart` command.
3434
plugin :tmp_restart
3535

36+
# Adds a drain period during shutdown so swarm can elegantly remove it from
37+
# the routing mesh
38+
plugin :delayed_stop
39+
3640
# Run the Solid Queue supervisor inside of Puma for single-server deployments
3741
plugin :solid_queue if ENV['SOLID_QUEUE_IN_PUMA']
3842

0 commit comments

Comments
 (0)