Skip to content

Commit

Permalink
Don't override client session timeout (#29)
Browse files Browse the repository at this point in the history
  • Loading branch information
mib1185 authored Feb 11, 2024
1 parent 64e8f6b commit 618c511
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 7 deletions.
6 changes: 2 additions & 4 deletions aiopegelonline/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

from aiohttp.client import ClientSession

from .const import BASE_URL, CONNECT_ERRORS, LOGGER, REQUEST_TIMEOUT
from .const import BASE_URL, CONNECT_ERRORS, LOGGER
from .exceptions import PegelonlineDataError
from .models import Station, StationMeasurements

Expand All @@ -22,9 +22,7 @@ async def _async_do_request(self, url: str, params: dict):
"""Perform an async request."""
LOGGER.debug("REQUEST url: %s params: %s", url, params)
try:
async with self.session.get(
url, params=params, timeout=REQUEST_TIMEOUT
) as resp:
async with self.session.get(url, params=params) as resp:
result = await resp.text()
LOGGER.debug("RESPONSE status: %s text: %s", resp.status, result)
result = json.loads(result)
Expand Down
2 changes: 0 additions & 2 deletions aiopegelonline/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@

BASE_URL = "https://www.pegelonline.wsv.de/webservices/rest-api/v2"

REQUEST_TIMEOUT = 10

CONNECT_ERRORS = (
aiohttp.ClientError,
asyncio.TimeoutError,
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""Setup module for aiopegelonline."""
from pathlib import Path

from setuptools import find_packages, setup
from setuptools import setup

PROJECT_DIR = Path(__file__).parent.resolve()
README_FILE = PROJECT_DIR / "README.md"
Expand Down

0 comments on commit 618c511

Please sign in to comment.