mirror of
https://github.com/Garmelon/PFERD.git
synced 2023-12-21 10:23:01 +01:00
Do not set a timeout for whole HTTP request
Downloads might take longer!
This commit is contained in:
parent
1739c54091
commit
9ce20216b5
@ -155,7 +155,15 @@ class HttpCrawler(Crawler):
|
|||||||
async with aiohttp.ClientSession(
|
async with aiohttp.ClientSession(
|
||||||
headers={"User-Agent": f"{NAME}/{VERSION}"},
|
headers={"User-Agent": f"{NAME}/{VERSION}"},
|
||||||
cookie_jar=self._cookie_jar,
|
cookie_jar=self._cookie_jar,
|
||||||
timeout=ClientTimeout(total=self._http_timeout)
|
timeout=ClientTimeout(
|
||||||
|
# 30 minutes. No download in the history of downloads was longer than 30 minutes.
|
||||||
|
# This is enough to transfer a 600 MB file over a 3 Mib/s connection.
|
||||||
|
# Allowing an arbitrary value could be annoying for overnight batch jobs
|
||||||
|
total=15 * 60,
|
||||||
|
connect=self._http_timeout,
|
||||||
|
sock_connect=self._http_timeout,
|
||||||
|
sock_read=self._http_timeout,
|
||||||
|
)
|
||||||
) as session:
|
) as session:
|
||||||
self.session = session
|
self.session = session
|
||||||
try:
|
try:
|
||||||
|
Loading…
Reference in New Issue
Block a user