mirror of https://github.com/rails/rails
Updates for Puma 6
This commit is contained in:
parent
c6886a1ab0
commit
6c674e4425
2
Gemfile
2
Gemfile
|
@ -79,7 +79,7 @@ end
|
|||
|
||||
# Action Cable
|
||||
group :cable do
|
||||
gem "puma", require: false
|
||||
gem "puma", ">= 5.0.3", require: false
|
||||
|
||||
gem "redis", ">= 4.0.1", require: false
|
||||
|
||||
|
|
|
@ -372,7 +372,7 @@ GEM
|
|||
rack
|
||||
railties (>= 7.0.0.alpha2)
|
||||
public_suffix (4.0.6)
|
||||
puma (5.5.2)
|
||||
puma (5.6.5)
|
||||
nio4r (~> 2.0)
|
||||
queue_classic (4.0.0)
|
||||
pg (>= 1.1, < 2.0)
|
||||
|
@ -587,7 +587,7 @@ DEPENDENCIES
|
|||
nokogiri (>= 1.8.1, != 1.11.0)
|
||||
pg (~> 1.3)
|
||||
propshaft (>= 0.1.7)
|
||||
puma
|
||||
puma (>= 5.0.3)
|
||||
queue_classic (>= 4.0.0)
|
||||
racc (>= 1.4.6)
|
||||
rack-cache (~> 1.2)
|
||||
|
|
|
@ -74,10 +74,15 @@ class ClientTest < ActionCable::TestCase
|
|||
end
|
||||
|
||||
def with_puma_server(rack_app = ActionCable.server, port = 3099)
|
||||
server = ::Puma::Server.new(rack_app, ::Puma::Events.strings)
|
||||
opts = { min_threads: 1, max_threads: 4 }
|
||||
server = if Puma::Const::PUMA_VERSION >= "6"
|
||||
opts[:log_writer] = ::Puma::LogWriter.strings
|
||||
::Puma::Server.new(rack_app, nil, opts)
|
||||
else
|
||||
# Puma >= 5.0.3
|
||||
::Puma::Server.new(rack_app, ::Puma::Events.strings, opts)
|
||||
end
|
||||
server.add_tcp_listener "127.0.0.1", port
|
||||
server.min_threads = 1
|
||||
server.max_threads = 4
|
||||
|
||||
thread = server.run
|
||||
|
||||
|
|
Loading…
Reference in New Issue