11from typing import Any , Awaitable , Callable , Optional , TypeVar
22
3- from hyperbrowser .models .consts import POLLING_ATTEMPTS
4-
53from ..polling import (
64 build_fetch_operation_name ,
75 collect_paginated_results ,
86 collect_paginated_results_async ,
97 retry_operation ,
108 retry_operation_async ,
119)
10+ from .polling_defaults import (
11+ DEFAULT_POLLING_RETRY_ATTEMPTS ,
12+ DEFAULT_POLLING_RETRY_DELAY_SECONDS ,
13+ )
1214
1315T = TypeVar ("T" )
1416R = TypeVar ("R" )
@@ -22,8 +24,8 @@ def retry_operation_with_defaults(
2224 return retry_operation (
2325 operation_name = operation_name ,
2426 operation = operation ,
25- max_attempts = POLLING_ATTEMPTS ,
26- retry_delay_seconds = 0.5 ,
27+ max_attempts = DEFAULT_POLLING_RETRY_ATTEMPTS ,
28+ retry_delay_seconds = DEFAULT_POLLING_RETRY_DELAY_SECONDS ,
2729 )
2830
2931
@@ -35,8 +37,8 @@ async def retry_operation_with_defaults_async(
3537 return await retry_operation_async (
3638 operation_name = operation_name ,
3739 operation = operation ,
38- max_attempts = POLLING_ATTEMPTS ,
39- retry_delay_seconds = 0.5 ,
40+ max_attempts = DEFAULT_POLLING_RETRY_ATTEMPTS ,
41+ retry_delay_seconds = DEFAULT_POLLING_RETRY_DELAY_SECONDS ,
4042 )
4143
4244
@@ -86,8 +88,8 @@ def collect_paginated_results_with_defaults(
8688 get_total_page_batches = get_total_page_batches ,
8789 on_page_success = on_page_success ,
8890 max_wait_seconds = max_wait_seconds ,
89- max_attempts = POLLING_ATTEMPTS ,
90- retry_delay_seconds = 0.5 ,
91+ max_attempts = DEFAULT_POLLING_RETRY_ATTEMPTS ,
92+ retry_delay_seconds = DEFAULT_POLLING_RETRY_DELAY_SECONDS ,
9193 )
9294
9395
@@ -107,6 +109,6 @@ async def collect_paginated_results_with_defaults_async(
107109 get_total_page_batches = get_total_page_batches ,
108110 on_page_success = on_page_success ,
109111 max_wait_seconds = max_wait_seconds ,
110- max_attempts = POLLING_ATTEMPTS ,
111- retry_delay_seconds = 0.5 ,
112+ max_attempts = DEFAULT_POLLING_RETRY_ATTEMPTS ,
113+ retry_delay_seconds = DEFAULT_POLLING_RETRY_DELAY_SECONDS ,
112114 )
0 commit comments