David542
David542

Reputation: 110562

How to set grequests timeout

How would I accomplish the following:

rs = (self.exporter.grequester(url) for url in url_chunk)
res_items = grequests.map(rs, timeout=10s) # this is the item that times out

Upvotes: 6

Views: 4244

Answers (1)

Natan
Natan

Reputation: 136

Try this:

reqs = grequests.map(grequests.get(link, headers=header,  timeout=1) for link in links)

source

Upvotes: 8

Related Questions