mirror of
https://gitea.invidious.io/iv-org/shard-kemal.git
synced 2024-08-15 00:53:36 +00:00
Crystal 0.25.0 (#452)
This commit is contained in:
parent
c2236acf3a
commit
a5870e7d24
9 changed files with 23 additions and 22 deletions
|
@ -59,7 +59,7 @@ module Kemal
|
|||
end
|
||||
end
|
||||
|
||||
config.server ||= HTTP::Server.new(config.host_binding, config.port, config.handlers)
|
||||
server = config.server ||= HTTP::Server.new(config.handlers)
|
||||
|
||||
{% if !flag?(:without_openssl) %}
|
||||
config.server.not_nil!.tls = config.ssl
|
||||
|
@ -68,13 +68,13 @@ module Kemal
|
|||
config.running = true
|
||||
|
||||
yield config
|
||||
config.server.not_nil!.listen if config.env != "test" && config.server
|
||||
server.listen(config.host_binding, config.port) if config.env != "test"
|
||||
end
|
||||
|
||||
def self.stop
|
||||
if config.running
|
||||
if config.server
|
||||
config.server.not_nil!.close
|
||||
if server = config.server
|
||||
server.close unless server.closed?
|
||||
config.running = false
|
||||
else
|
||||
raise "Kemal.config.server is not set. Please use Kemal.run to set the server."
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue