utils.http.request_() has no self, let alone self.log
This commit is contained in:
parent
b69c9146b2
commit
d8e3a1c7ee
1 changed files with 4 additions and 3 deletions
|
@ -216,6 +216,8 @@ def _request(request_obj: Request) -> Response:
|
||||||
else:
|
else:
|
||||||
return response
|
return response
|
||||||
|
|
||||||
|
class RequestManyException(Exception):
|
||||||
|
pass
|
||||||
def request_many(urls: typing.List[str]) -> typing.Dict[str, Response]:
|
def request_many(urls: typing.List[str]) -> typing.Dict[str, Response]:
|
||||||
responses = {}
|
responses = {}
|
||||||
|
|
||||||
|
@ -227,9 +229,8 @@ def request_many(urls: typing.List[str]) -> typing.Dict[str, Response]:
|
||||||
try:
|
try:
|
||||||
response = await client.fetch(request)
|
response = await client.fetch(request)
|
||||||
except:
|
except:
|
||||||
self.log.critical("request_many failed for %s", [url],
|
raise RequestManyException(
|
||||||
exc_info=True)
|
"request_many failed for %s", [url])
|
||||||
return None
|
|
||||||
|
|
||||||
headers = utils.CaseInsensitiveDict(dict(response.headers))
|
headers = utils.CaseInsensitiveDict(dict(response.headers))
|
||||||
data = response.body.decode("utf8")
|
data = response.body.decode("utf8")
|
||||||
|
|
Loading…
Reference in a new issue