add tenacity to retry transient blockouts by rightmove
This commit is contained in:
parent
289206afc0
commit
9b2653ce91
3 changed files with 20 additions and 3 deletions
|
|
@ -1,12 +1,11 @@
|
|||
# from diskcache import Cache
|
||||
import asyncio
|
||||
from dataclasses import dataclass
|
||||
from datetime import datetime
|
||||
import enum
|
||||
from typing import Any
|
||||
import aiohttp
|
||||
from data_access import Listing
|
||||
from models.listing import FurnishType, ListingType, QueryParameters
|
||||
from tenacity import retry, wait_random
|
||||
|
||||
|
||||
headers = {
|
||||
|
|
@ -27,6 +26,7 @@ class PropertyType(enum.StrEnum):
|
|||
TERRACED = "terraced"
|
||||
|
||||
|
||||
@retry(wait=wait_random(min=1, max=2))
|
||||
async def detail_query(detail_id: int) -> dict[str, Any]:
|
||||
params = {
|
||||
"apiApplication": "ANDROID",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue