Python uwsgi.masterpid() Examples
The following are 2
code examples of uwsgi.masterpid().
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example.
You may also want to check out all available functions/classes of the module
uwsgi
, or try the search function
.
Example #1
Source File: multiprocess.py From prometheus_flask_exporter with MIT License | 5 votes |
def should_start_http_server(self): import uwsgi return os.getpid() == uwsgi.masterpid()
Example #2
Source File: __init__.py From apm-agent-python with BSD 3-Clause "New" or "Revised" License | 5 votes |
def is_master_process(): # currently only recognizes uwsgi master process try: import uwsgi return os.getpid() == uwsgi.masterpid() except ImportError: return False