MCPcopy Create free account
hub / github.com/Dispatcharr/Dispatcharr / _is_worker_process

Function _is_worker_process

dispatcharr/app_initialization.py:11–19  ·  view source on GitHub ↗

Check if this process is a worker spawned by uwsgi/gunicorn.

()

Source from the content-addressed store, hash-verified

9
10
11def _is_worker_process():
12 """Check if this process is a worker spawned by uwsgi/gunicorn."""
13 try:
14 parent = psutil.Process(os.getppid())
15 parent_name = parent.name()
16 return parent_name in ['uwsgi', 'gunicorn']
17 except Exception:
18 # If we can't determine, assume it's not a worker (safe default)
19 return False
20
21
22def should_skip_initialization():

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected