Skip to content

Commit 062ffc7

Browse files
committed
fix: type of aiohttp client timeout
1 parent 89132bb commit 062ffc7

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

Diff for: backend/app/models/feed.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
from feedgen.feed import FeedGenerator
77
from collections.abc import Iterator
88
import feedparser
9-
from aiohttp import ClientSession
9+
from aiohttp import ClientSession, ClientTimeout
1010

1111
import re
1212
import dateparser
@@ -163,7 +163,7 @@ async def parse_feed(feed_url: HttpUrl) -> Feed:
163163
r"^(25[0-5]|(2[0-4]|1\d|[1-9]|)\d)\.?\b", feed_url.host
164164
):
165165
raise RuntimeError("Invalid URL")
166-
async with ClientSession(timeout=10) as aiohttp_session:
166+
async with ClientSession(timeout=ClientTimeout(total=20)) as aiohttp_session:
167167
try:
168168
async with aiohttp_session.get(
169169
str(feed_url),

Diff for: backend/tests/e2e/test_e2e_all.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import asyncio
44
from os import getenv
55

6-
from aiohttp import ClientSession
6+
from aiohttp import ClientSession, ClientTimeout
77

88
API_URL: str
99

@@ -47,7 +47,7 @@ class TestGetFeeds:
4747
@pytest.mark.asyncio
4848
async def test_get_feeds_new_user(self):
4949
"""Test the main use case with a new user."""
50-
async with ClientSession(timeout=30) as session:
50+
async with ClientSession(timeout=ClientTimeout(total=10)) as session:
5151
# get all feeds at once
5252
results = await asyncio.gather(
5353
*[

0 commit comments

Comments
 (0)