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

Method _connect

gunicorn/dirty/stash.py:114–126  ·  view source on GitHub ↗

Establish connection to arbiter.

(self)

Source from the content-addressed store, hash-verified

112 return str(uuid.uuid4())
113
114 def _connect(self):
115 """Establish connection to arbiter."""
116 import socket
117 if self._sock is not None:
118 return
119
120 try:
121 self._sock = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
122 self._sock.settimeout(self.timeout)
123 self._sock.connect(self.socket_path)
124 except (socket.error, OSError) as e:
125 self._sock = None
126 raise StashError(f"Failed to connect to arbiter: {e}") from e
127
128 def _close(self):
129 """Close the connection."""

Callers 1

_executeMethod · 0.95

Calls 3

StashErrorClass · 0.85
settimeoutMethod · 0.45
connectMethod · 0.45

Tested by

no test coverage detected