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

Method murder_keepalived

gunicorn/workers/gthread.py:315–331  ·  view source on GitHub ↗

Close expired keepalive connections.

(self)

Source from the content-addressed store, hash-verified

313 self.enqueue_req(conn)
314
315 def murder_keepalived(self):
316 """Close expired keepalive connections."""
317 now = time.monotonic()
318 while self.keepalived_conns:
319 conn = self.keepalived_conns[0]
320 delta = conn.timeout - now
321 if delta > 0:
322 break
323
324 # Connection has timed out
325 self.keepalived_conns.popleft()
326 try:
327 self.poller.unregister(conn.sock)
328 except (OSError, KeyError, ValueError):
329 pass # Already unregistered
330 self.nr_conns -= 1
331 conn.close()
332
333 def murder_pending(self):
334 """Close expired pending connections (waiting for initial data)."""

Callers 3

runMethod · 0.95

Calls 1

closeMethod · 0.45

Tested by 2