Skip to content

Commit

Permalink
Switch from WEBrick to Puma
Browse files Browse the repository at this point in the history
  • Loading branch information
tschafer-gc committed Nov 8, 2024
1 parent b6bab65 commit 1702563
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 29 deletions.
39 changes: 12 additions & 27 deletions bin/que
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,12 @@
require "logger"
require "optparse"
require "ostruct"
require "que"
require "rack"
require "prometheus/middleware/exporter"
require "prometheus_gcstat"
require "webrick"

if Rack.release[0] == "3"
# Required if using Rack 3.x
require "rackup"
end
require "puma"
require "que"
require "rack"
require "rack/handler/puma"

$stdout.sync = true

Expand Down Expand Up @@ -176,25 +172,14 @@ if options.metrics_port
)

host = "0.0.0.0"
logger = WEBrick::Log.new("/dev/null")

if Rack.release[0] == "3"
Rackup::Handler::WEBrick.run(
app,
Host: host,
Port: options.metrics_port,
Logger: logger,
AccessLog: [],
)
else
Rack::Handler::WEBrick.run(
app,
Host: host,
Port: options.metrics_port,
Logger: logger,
AccessLog: [],
)
end

Rack::Handler::Puma.run(
app,
Host: host,
Port: options.metrics_port,
Silent: false,
AccessLog: [],
)
end
end

Expand Down
3 changes: 1 addition & 2 deletions que.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,8 @@ Gem::Specification.new do |spec|
# This is highly non ideal, but unless we properly fork, we have to do this for now.
spec.add_dependency "prometheus-client"

spec.add_dependency "puma"
spec.add_dependency "rack", ">= 2", "< 4"
spec.add_dependency "rackup"
spec.add_dependency "webrick"

spec.add_runtime_dependency "activesupport"
spec.metadata["rubygems_mfa_required"] = "true"
Expand Down

0 comments on commit 1702563

Please sign in to comment.