Skip to content

Commit 50d3af8

Browse files
committed
Allow fractional max retries
1 parent 129bcda commit 50d3af8

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

weaviate/collections/batch/base.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
CONCURRENT_REQUESTS_DYNAMIC_VECTORIZER = 2
5656
BATCH_TIME_TARGET = 10
5757
VECTORIZER_BATCHING_STEP_SIZE = 48 # cohere max batch size is 96
58-
MAX_RETRIES = int(os.getenv("WEAVIATE_BATCH_MAX_RETRIES", "9"))
58+
MAX_RETRIES = float(os.getenv("WEAVIATE_BATCH_MAX_RETRIES", "9"))
5959

6060

6161
class BatchRequest(ABC, Generic[TBatchInput, TBatchReturn]):

weaviate/collections/batch/grpc_batch_objects.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ def __grpc_objects(self, objects: List[_BatchObject]) -> List[batch_pb2.BatchObj
7878
]
7979

8080
async def objects(
81-
self, objects: List[_BatchObject], timeout: Union[int, float], max_retries: int
81+
self, objects: List[_BatchObject], timeout: Union[int, float], max_retries: float
8282
) -> BatchObjectReturn:
8383
"""Insert multiple objects into Weaviate through the gRPC API.
8484
@@ -133,7 +133,7 @@ async def objects(
133133
)
134134

135135
async def __send_batch(
136-
self, batch: List[batch_pb2.BatchObject], timeout: Union[int, float], max_retries: int
136+
self, batch: List[batch_pb2.BatchObject], timeout: Union[int, float], max_retries: float
137137
) -> Dict[int, str]:
138138
try:
139139
assert self._connection.grpc_stub is not None

weaviate/collections/grpc/retry.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414

1515
class _Retry:
16-
def __init__(self, n: int = 4) -> None:
16+
def __init__(self, n: float = 4) -> None:
1717
self.n = n
1818

1919
async def with_exponential_backoff(

0 commit comments

Comments
 (0)