Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 26 additions & 7 deletions aredis/connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -593,11 +593,21 @@ def __init__(self, host='127.0.0.1', port=6379, password=None,
self.socket_keepalive_options = socket_keepalive_options or {}

async def _connect(self):
if LOOP_DEPRECATED:
connection = asyncio.open_connection(
host=self.host,
port=self.port,
ssl=self.ssl_context
)
else:
connection = asyncio.open_connection(
host=self.host,
port=self.port,
ssl=self.ssl_context,
loop=self.loop
)
reader, writer = await exec_with_timeout(
asyncio.open_connection(host=self.host,
port=self.port,
ssl=self.ssl_context,
loop=self.loop),
connection,
self._connect_timeout,
loop=self.loop
)
Expand Down Expand Up @@ -642,10 +652,19 @@ def __init__(self, path='', password=None,
}

async def _connect(self):
if LOOP_DEPRECATED:
connection = asyncio.open_unix_connection(
path=self.path,
ssl=self.ssl_context
)
else:
connection = asyncio.open_unix_connection(
path=self.path,
ssl=self.ssl_context,
loop=self.loop
)
reader, writer = await exec_with_timeout(
asyncio.open_unix_connection(path=self.path,
ssl=self.ssl_context,
loop=self.loop),
connection,
self._connect_timeout,
loop=self.loop
)
Expand Down