mirror of
https://github.com/puma/puma.git
synced 2022-11-09 13:48:40 -05:00
Error out early if there is no app configured
This commit is contained in:
parent
93ed2480d8
commit
bc6b825128
2 changed files with 21 additions and 0 deletions
|
@ -419,6 +419,11 @@ module Puma
|
||||||
|
|
||||||
@binder.parse @options[:binds], self
|
@binder.parse @options[:binds], self
|
||||||
|
|
||||||
|
unless @config.app_configured?
|
||||||
|
error "No application configured, nothing to run"
|
||||||
|
exit 1
|
||||||
|
end
|
||||||
|
|
||||||
if @options[:daemon]
|
if @options[:daemon]
|
||||||
Process.daemon(true, @io_redirected)
|
Process.daemon(true, @io_redirected)
|
||||||
end
|
end
|
||||||
|
@ -651,6 +656,11 @@ module Puma
|
||||||
|
|
||||||
@binder.parse @options[:binds], self
|
@binder.parse @options[:binds], self
|
||||||
|
|
||||||
|
unless @config.app_configured?
|
||||||
|
error "No application configured, nothing to run"
|
||||||
|
exit 1
|
||||||
|
end
|
||||||
|
|
||||||
read, write = Puma::Util.pipe
|
read, write = Puma::Util.pipe
|
||||||
|
|
||||||
Signal.trap "SIGCHLD" do
|
Signal.trap "SIGCHLD" do
|
||||||
|
|
|
@ -67,6 +67,17 @@ module Puma
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# Indicate if there is a properly configured app
|
||||||
|
#
|
||||||
|
def app_configured?
|
||||||
|
return true if @options[:app]
|
||||||
|
if path = @options[:rackup]
|
||||||
|
return File.exists?(path)
|
||||||
|
end
|
||||||
|
|
||||||
|
false
|
||||||
|
end
|
||||||
|
|
||||||
# Load the specified rackup file, pull an options from
|
# Load the specified rackup file, pull an options from
|
||||||
# the rackup file, and set @app.
|
# the rackup file, and set @app.
|
||||||
#
|
#
|
||||||
|
|
Loading…
Add table
Reference in a new issue