mirror of
https://github.com/frappe/gunicorn.git
synced 2026-01-14 11:09:11 +08:00
close #170 .
add --check-config option to check the config and app loading.
This commit is contained in:
parent
7a1c58f236
commit
cc26270783
@ -102,6 +102,19 @@ class Application(object):
|
|||||||
return self.callable
|
return self.callable
|
||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
|
if self.cfg.check_config:
|
||||||
|
try:
|
||||||
|
|
||||||
|
self.load()
|
||||||
|
except:
|
||||||
|
sys.stderr.write("\nError while loading the application:\n\n")
|
||||||
|
traceback.print_exc()
|
||||||
|
|
||||||
|
sys.stderr.flush()
|
||||||
|
sys.exit(1)
|
||||||
|
|
||||||
|
sys.exit(0)
|
||||||
|
|
||||||
if self.cfg.spew:
|
if self.cfg.spew:
|
||||||
debug.spew()
|
debug.spew()
|
||||||
if self.cfg.daemon:
|
if self.cfg.daemon:
|
||||||
|
|||||||
@ -507,6 +507,17 @@ class Spew(Setting):
|
|||||||
This is the nuclear option.
|
This is the nuclear option.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
class ConfigCheck(Setting):
|
||||||
|
name = "check_config"
|
||||||
|
section = "Debugging"
|
||||||
|
cli = ["--check-config",]
|
||||||
|
validator = validate_bool
|
||||||
|
action = "store_true"
|
||||||
|
default = False
|
||||||
|
desc = """\
|
||||||
|
Check the configuration..
|
||||||
|
"""
|
||||||
|
|
||||||
class PreloadApp(Setting):
|
class PreloadApp(Setting):
|
||||||
name = "preload_app"
|
name = "preload_app"
|
||||||
section = "Server Mechanics"
|
section = "Server Mechanics"
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user