You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
print(f"batch RPC call with {len(requests_info)} requests got exception {repr(e)}, splitting and retrying")
40
39
else:
41
-
iflen(response) ==len(requests_info):
40
+
iflen(response) !=len(requests_info):
41
+
print(f"made batch request with size {len(requests_info)} but only received {len(response)} results. splitting and retrying.{f' Sample response: {response[0]}'iflen(response) !=0else''}")
print(f"{len(requests_retry)}/{len(requests_info)} requests in batch failed, retrying. Example response: {response[request_indexes[0][0]]}")
53
-
iflen(requests_retry)==len(requests_info):
54
-
# all failed, let's wait a moment before retrying
55
-
sleep(1)
51
+
iflen(requests_retry) ==0:
52
+
returnresponse
53
+
54
+
print(f"{len(requests_retry)}/{len(requests_info)} requests in batch failed, retrying. Example response: {response[request_indexes[0][0]]}")
55
+
56
+
iflen(requests_retry) !=len(requests_info): # if some requests succeeded, retry failed requests
56
57
response_new=middleware(requests_retry)
57
58
forold_idx, new_idxinrequest_indexes:
58
59
response[old_idx] =response_new[new_idx]
60
+
returnresponse
59
61
60
-
returnresponse
61
-
else:
62
-
print(f"made batch request with size {len(requests_info)} but only received {len(response)} results. splitting and retrying.{f' Sample response: {response[0]}'iflen(response) !=0else''}")
0 commit comments