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

Method run

gunicorn/workers/sync.py:111–132  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

109 return
110
111 def run(self):
112 # if no timeout is given the worker will never wait and will
113 # use the CPU for nothing. This minimal timeout prevent it.
114 timeout = self.timeout or 0.5
115
116 # Warn if HTTP/2 is requested - sync worker doesn't support it
117 if 'h2' in self.cfg.http_protocols:
118 self.log.warning(
119 "HTTP/2 is not supported by the sync worker. "
120 "Use gthread, gevent, or asgi workers for HTTP/2 support. "
121 "Falling back to HTTP/1.1 only."
122 )
123
124 # self.socket appears to lose its blocking status after
125 # we fork in the arbiter. Reset it here.
126 for s in self.sockets:
127 s.setblocking(0)
128
129 if len(self.sockets) > 1:
130 self.run_for_multiple(timeout)
131 else:
132 self.run_for_one(timeout)
133
134 def handle(self, listener, client, addr):
135 req = None

Callers

nothing calls this directly

Calls 4

run_for_multipleMethod · 0.95
run_for_oneMethod · 0.95
warningMethod · 0.45
setblockingMethod · 0.45

Tested by

no test coverage detected