mirror of
https://github.com/frappe/gunicorn.git
synced 2026-01-14 11:09:11 +08:00
parent
eb485d2134
commit
30177b879a
@ -41,6 +41,11 @@ class BaseSocket(object):
|
|||||||
if not bound:
|
if not bound:
|
||||||
self.bind(sock)
|
self.bind(sock)
|
||||||
sock.setblocking(0)
|
sock.setblocking(0)
|
||||||
|
|
||||||
|
# make sure that the socket can be inherited
|
||||||
|
if hasattr(sock, "set_inheritable"):
|
||||||
|
sock.set_inheritable(True)
|
||||||
|
|
||||||
sock.listen(self.conf.backlog)
|
sock.listen(self.conf.backlog)
|
||||||
return sock
|
return sock
|
||||||
|
|
||||||
@ -110,6 +115,7 @@ class UnixSocket(BaseSocket):
|
|||||||
util.chown(self.cfg_addr, self.conf.uid, self.conf.gid)
|
util.chown(self.cfg_addr, self.conf.uid, self.conf.gid)
|
||||||
os.umask(old_umask)
|
os.umask(old_umask)
|
||||||
|
|
||||||
|
|
||||||
def close(self):
|
def close(self):
|
||||||
super(UnixSocket, self).close()
|
super(UnixSocket, self).close()
|
||||||
os.unlink(self.cfg_addr)
|
os.unlink(self.cfg_addr)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user