Skip to content

Commit

Permalink
Add support for unix domain sockets to gunicorn worker #470
Browse files Browse the repository at this point in the history
  • Loading branch information
asvetlov committed Jan 29, 2016
1 parent c9ed4f8 commit 1ac5e26
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
2 changes: 2 additions & 0 deletions CHANGES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -64,3 +64,5 @@ CHANGES
- Close client connection on exception in ClientResponse.release()

- Allow to read multipart parts without content-length specified #750

- Add support for unix domain sockets to gunicorn worker #470
6 changes: 2 additions & 4 deletions aiohttp/worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,13 @@ def run(self):

sys.exit(self.exit_code)

def make_handler(self, app, host, port):
def make_handler(self, app):
if hasattr(self.cfg, 'debug'):
is_debug = self.cfg.debug
else:
is_debug = self.log.loglevel == logging.DEBUG

return app.make_handler(
host=host,
port=port,
logger=self.log,
debug=is_debug,
timeout=self.cfg.timeout,
Expand Down Expand Up @@ -83,7 +81,7 @@ def close(self):
@asyncio.coroutine
def _run(self):
for sock in self.sockets:
handler = self.make_handler(self.wsgi, *sock.cfg_addr)
handler = self.make_handler(self.wsgi)
srv = yield from self.loop.create_server(handler, sock=sock.sock)
self.servers[srv] = handler

Expand Down
3 changes: 1 addition & 2 deletions tests/test_worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,7 @@ def test_make_handler(worker):
worker.log = mock.Mock()
worker.cfg = mock.Mock()

f = worker.make_handler(
worker.wsgi, 'localhost', 8080)
f = worker.make_handler(worker.wsgi)
assert f is worker.wsgi.make_handler.return_value


Expand Down

0 comments on commit 1ac5e26

Please sign in to comment.