Skip to content
This repository was archived by the owner on Mar 20, 2023. It is now read-only.

Replace aiohttp.Timeout with async_timeout.timeout #38

Merged
merged 1 commit into from
Mar 20, 2018
Merged
Show file tree
Hide file tree
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
3 changes: 2 additions & 1 deletion elasticsearch_async/connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import aiohttp
from aiohttp.client_exceptions import ServerFingerprintMismatch
import async_timeout

from elasticsearch.exceptions import ConnectionError, ConnectionTimeout, SSLError
from elasticsearch.connection import Connection
Expand Down Expand Up @@ -90,7 +91,7 @@ def perform_request(self, method, url, params=None, body=None, timeout=None, ign
start = self.loop.time()
response = None
try:
with aiohttp.Timeout(timeout or self.timeout, loop=self.loop):
with async_timeout.timeout(timeout or self.timeout, loop=self.loop):
response = yield from self.session.request(method, url, data=body, headers=headers)
raw_data = yield from response.text()
duration = self.loop.time() - start
Expand Down
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

install_requires = [
'aiohttp',
'async_timeout',
'elasticsearch>=6.0.0',
]

Expand Down