Ensure server and config vars always defined before fallback server is started
This commit is contained in:
parent
b45f5651ab
commit
3a1c3bb026
1 changed files with 4 additions and 0 deletions
|
|
@ -45,6 +45,10 @@ def serve_from_cli(argv: Optional[list[str]] = None):
|
|||
log_config["loggers"]["uvicorn"]["propagate"] = True
|
||||
log_config["loggers"]["uvicorn.access"]["propagate"] = True
|
||||
|
||||
# Create server and config vars before trying to configure so they are defined
|
||||
# if fallback is needed before they are set.
|
||||
config = None
|
||||
server = None
|
||||
try:
|
||||
config = cli.config_from_args(args)
|
||||
log_folder = config.get("log_folder", "./openflexure/logs")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue