Remove experimental fork mode

This commit is contained in:
Sdogruyol 2015-12-19 10:00:29 +02:00
parent 20ef2b2927
commit 44af664748
2 changed files with 2 additions and 12 deletions

View File

@ -9,9 +9,6 @@ at_exit do
opts.on("-e ", "--environment ", "environment") do |env| opts.on("-e ", "--environment ", "environment") do |env|
Kemal.config.env = env Kemal.config.env = env
end end
opts.on("-w VALUE", "--workers", "workers") do |workers|
Kemal.config.workers = workers.to_i
end
end end
config = Kemal.config config = Kemal.config
@ -39,11 +36,5 @@ at_exit do
File.read(file_path) File.read(file_path)
end end
workers = Kemal.config.workers server.listen
if workers > 1
logger.write "Kemal is starting with #{workers} workers!"
server.listen_fork workers: workers
else
server.listen
end
end end

View File

@ -4,12 +4,11 @@ module Kemal
class Config class Config
INSTANCE = Config.new INSTANCE = Config.new
HANDLERS = [] of HTTP::Handler HANDLERS = [] of HTTP::Handler
property ssl, port, env, workers, public_folder property ssl, port, env, public_folder
def initialize def initialize
@port = 3000 @port = 3000
@env = "development" unless @env @env = "development" unless @env
@workers = 1
@public_folder = "./public" @public_folder = "./public"
read_file read_file
end end