MCPcopy
hub / github.com/benoitc/gunicorn / show_config

Method show_config

gunicorn/ctl/handlers.py:129–162  ·  view source on GitHub ↗

Return current effective configuration. Returns: Dictionary of configuration values

(self)

Source from the content-addressed store, hash-verified

127 }
128
129 def show_config(self) -> dict:
130 """
131 Return current effective configuration.
132
133 Returns:
134 Dictionary of configuration values
135 """
136 cfg = self.arbiter.cfg
137 config = {}
138
139 # Get commonly needed config values
140 config_keys = [
141 'bind', 'workers', 'worker_class', 'threads', 'timeout',
142 'graceful_timeout', 'keepalive', 'max_requests',
143 'max_requests_jitter', 'worker_connections', 'preload_app',
144 'daemon', 'pidfile', 'proc_name', 'reload',
145 'dirty_workers', 'dirty_apps', 'dirty_timeout',
146 'control_socket', 'control_socket_disable',
147 ]
148
149 for key in config_keys:
150 try:
151 value = getattr(cfg, key)
152 # Convert non-serializable types
153 if callable(value):
154 value = str(value)
155 elif hasattr(value, '__class__') and not isinstance(
156 value, (str, int, float, bool, list, dict, type(None))):
157 value = str(value)
158 config[key] = value
159 except AttributeError:
160 pass
161
162 return config
163
164 def show_stats(self) -> dict:
165 """

Callers 2

test_show_configMethod · 0.95
_handle_showMethod · 0.80

Calls

no outgoing calls

Tested by 1

test_show_configMethod · 0.76