From 529392fecf816fa201530cbb09037110f2ea41a6 Mon Sep 17 00:00:00 2001 From: tschafer-gc Date: Fri, 8 Nov 2024 22:46:12 +0000 Subject: [PATCH] Fix imports --- bin/que | 14 +++++++++++++- que.gemspec | 1 + 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/bin/que b/bin/que index 353b5b4..13e7baf 100755 --- a/bin/que +++ b/bin/que @@ -9,6 +9,11 @@ require "prometheus_gcstat" require "puma" require "que" require "rack" +USE_RACKUP = Rack.release.split(".")[0].to_i >= 3 +if USE_RACKUP + require "rackup" +end +require "rack/handler/puma" $stdout.sync = true @@ -172,7 +177,14 @@ if options.metrics_port host = "0.0.0.0" - Rack::Handler::Puma.run( + handler = + if USE_RACKUP + Rackup::Handler::Puma + else + Rack::Handler::Puma + end + + handler.run( app, Host: host, Port: options.metrics_port, diff --git a/que.gemspec b/que.gemspec index e0e5197..bc5ffc5 100644 --- a/que.gemspec +++ b/que.gemspec @@ -29,6 +29,7 @@ Gem::Specification.new do |spec| spec.add_dependency "puma" spec.add_dependency "rack", ">= 2", "< 4" + spec.add_dependency "rackup" spec.add_runtime_dependency "activesupport" spec.metadata["rubygems_mfa_required"] = "true"