File tree 2 files changed +4
-4
lines changed
2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change 6
6
from feedgen .feed import FeedGenerator
7
7
from collections .abc import Iterator
8
8
import feedparser
9
- from aiohttp import ClientSession
9
+ from aiohttp import ClientSession , ClientTimeout
10
10
11
11
import re
12
12
import dateparser
@@ -163,7 +163,7 @@ async def parse_feed(feed_url: HttpUrl) -> Feed:
163
163
r"^(25[0-5]|(2[0-4]|1\d|[1-9]|)\d)\.?\b" , feed_url .host
164
164
):
165
165
raise RuntimeError ("Invalid URL" )
166
- async with ClientSession (timeout = 10 ) as aiohttp_session :
166
+ async with ClientSession (timeout = ClientTimeout ( total = 20 ) ) as aiohttp_session :
167
167
try :
168
168
async with aiohttp_session .get (
169
169
str (feed_url ),
Original file line number Diff line number Diff line change 3
3
import asyncio
4
4
from os import getenv
5
5
6
- from aiohttp import ClientSession
6
+ from aiohttp import ClientSession , ClientTimeout
7
7
8
8
API_URL : str
9
9
@@ -47,7 +47,7 @@ class TestGetFeeds:
47
47
@pytest .mark .asyncio
48
48
async def test_get_feeds_new_user (self ):
49
49
"""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 :
51
51
# get all feeds at once
52
52
results = await asyncio .gather (
53
53
* [
You can’t perform that action at this time.
0 commit comments