limit the number of concurrenct requests when dumping listings as right move blocks us
This commit is contained in:
parent
24bf44caf9
commit
9735db72a0
2 changed files with 17 additions and 9 deletions
|
|
@ -39,6 +39,7 @@ async def dump_listings(
|
|||
print("Valid districts to scrape:", districts.keys())
|
||||
listings = []
|
||||
|
||||
semaphore = asyncio.Semaphore(5) # if too high, rightmove drops connections
|
||||
json_responses = await asyncio.gather(
|
||||
*[
|
||||
listing_query(
|
||||
|
|
@ -53,6 +54,7 @@ async def dump_listings(
|
|||
page_size=parameters.page_size,
|
||||
max_days_since_added=parameters.max_days_since_added,
|
||||
furnish_types=parameters.furnish_types or [],
|
||||
semaphore=semaphore,
|
||||
)
|
||||
for locid in districts.values()
|
||||
for i in [1, 2]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue