mirror of
https://gitea.invidious.io/iv-org/shard-kemal.git
synced 2024-08-15 00:53:36 +00:00
Don't initiliaze server if it's already initialized
This commit is contained in:
parent
ad692357d4
commit
0b07070237
2 changed files with 3 additions and 4 deletions
|
@ -164,5 +164,4 @@ describe "Kemal::RouteHandler" do
|
||||||
client_response.status_code.should eq(302)
|
client_response.status_code.should eq(302)
|
||||||
client_response.headers.has_key?("Location").should eq(true)
|
client_response.headers.has_key?("Location").should eq(true)
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
|
@ -13,6 +13,7 @@ module Kemal
|
||||||
log "[#{config.env}] Kemal is ready to lead at #{config.scheme}://#{config.host_binding}:#{config.port}"
|
log "[#{config.env}] Kemal is ready to lead at #{config.scheme}://#{config.host_binding}:#{config.port}"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
# Overload of self.run without port - fixex #399
|
# Overload of self.run without port - fixex #399
|
||||||
def self.run
|
def self.run
|
||||||
self.run(nil)
|
self.run(nil)
|
||||||
|
@ -58,11 +59,10 @@ module Kemal
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
server = HTTP::Server.new(config.host_binding, config.port, config.handlers)
|
config.server ||= HTTP::Server.new(config.host_binding, config.port, config.handlers)
|
||||||
{% if !flag?(:without_openssl) %}
|
{% if !flag?(:without_openssl) %}
|
||||||
server.tls = config.ssl
|
config.server.not_nil!.tls = config.ssl
|
||||||
{% end %}
|
{% end %}
|
||||||
config.server ||= server
|
|
||||||
config.running = true
|
config.running = true
|
||||||
|
|
||||||
yield config
|
yield config
|
||||||
|
|
Loading…
Reference in a new issue