(http_client: ClientSession, time_between_checks_sec: int = 5)
| 21 | |
| 22 | |
| 23 | async def wait_proxy(http_client: ClientSession, time_between_checks_sec: int = 5) -> str | None: |
| 24 | while True: |
| 25 | ip = await check_proxy(http_client) |
| 26 | if ip: |
| 27 | return ip |
| 28 | logger.trace(f"Proxy not available. Sleep {time_between_checks_sec} sec...") |
| 29 | await sleep(time_between_checks_sec) |