Skip to content

Commit

Permalink
adding info messages
Browse files Browse the repository at this point in the history
  • Loading branch information
ali96343 committed Nov 1, 2023
1 parent 92b4190 commit 6d1824f
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions py4web/server_adapters.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,7 @@ def get_gunicorn_vars(self, env_file="gunicorn.saenv"):
result[k] = None if v == 'None' else v
if result:
print(f"gunicorn: read {env_file}")
result['config'] = './' + env_file
return result
except OSError as ex:
print(f"gunicorn: cannot read {env_file}; {ex}")
Expand All @@ -206,6 +207,7 @@ def get_gunicorn_vars(self, env_file="gunicorn.saenv"):
if v.startswith('{') and v.endswith('}'):
v = json.loads( v.replace("'", "\"") )
result[key] = None if v == 'None' else v
result['config'] = 'environ'
return result

def load_config(self):
Expand Down Expand Up @@ -263,15 +265,16 @@ def load_config(self):
if 'use_native_config' in gunicorn_vars:
location=gunicorn_vars['use_native_config' ]
super().load_config_from_module_name_or_filename(location)
self.cfg.set('config', './' + location)
print (f'gunicorn: used config {location}')
return

if gunicorn_vars:
config.update(gunicorn_vars)
print("gunicorn: used config gunicorn.saenv", config)
location = gunicorn_vars['config']
print(f"gunicorn: used config {location}", config)

for k, v in config.items():
#self.cfg.set(k, v)
if k not in self.cfg.settings:
continue
try:
Expand Down

0 comments on commit 6d1824f

Please sign in to comment.