Skip to content

Commit

Permalink
feat: add tiemouts to aiohttp requests
Browse files Browse the repository at this point in the history
  • Loading branch information
m0wer committed Jul 17, 2024
1 parent 937f3af commit 89132bb
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion backend/app/models/feed.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ async def parse_feed(feed_url: HttpUrl) -> Feed:
r"^(25[0-5]|(2[0-4]|1\d|[1-9]|)\d)\.?\b", feed_url.host
):
raise RuntimeError("Invalid URL")
async with ClientSession() as aiohttp_session:
async with ClientSession(timeout=10) as aiohttp_session:
try:
async with aiohttp_session.get(
str(feed_url),
Expand Down
2 changes: 1 addition & 1 deletion backend/tests/e2e/test_e2e_all.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ class TestGetFeeds:
@pytest.mark.asyncio
async def test_get_feeds_new_user(self):
"""Test the main use case with a new user."""
async with ClientSession() as session:
async with ClientSession(timeout=30) as session:
# get all feeds at once
results = await asyncio.gather(
*[
Expand Down

0 comments on commit 89132bb

Please sign in to comment.