Add allocation optimizations (#487)

This commit is contained in:
Julien Reichardt 2018-11-01 12:29:05 +01:00 committed by Serdar Dogruyol
parent afd17fc774
commit 21ab64511a
12 changed files with 59 additions and 82 deletions

View file

@ -68,15 +68,12 @@ module Kemal
end
def self.stop
if config.running
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."
end
raise "Kemal is already stopped." if !config.running
if server = config.server
server.close unless server.closed?
config.running = false
else
raise "Kemal is already stopped."
raise "Kemal.config.server is not set. Please use Kemal.run to set the server."
end
end