mirror of
https://github.com/Garmelon/PFERD.git
synced 2023-12-21 10:23:01 +01:00
Retry crawling on I/O failure
This commit is contained in:
parent
9fd356d290
commit
cf6903d109
@ -596,12 +596,15 @@ class IliasCrawler(HttpCrawler):
|
|||||||
# TODO: Proper exception
|
# TODO: Proper exception
|
||||||
raise RuntimeError("Get page failed too often")
|
raise RuntimeError("Get page failed too often")
|
||||||
print(url)
|
print(url)
|
||||||
async with self.session.get(url) as request:
|
try:
|
||||||
soup = soupify(await request.read())
|
async with self.session.get(url) as request:
|
||||||
if self._is_logged_in(soup):
|
soup = soupify(await request.read())
|
||||||
return soup
|
if self._is_logged_in(soup):
|
||||||
|
return soup
|
||||||
|
|
||||||
await self._shibboleth_login.login(self.session)
|
await self._shibboleth_login.login(self.session)
|
||||||
|
except Exception:
|
||||||
|
return await self._get_page(url, retries_left - 1)
|
||||||
|
|
||||||
return await self._get_page(url, retries_left - 1)
|
return await self._get_page(url, retries_left - 1)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user