File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -208,14 +208,16 @@ def get_api(url):
208
208
def parallel_api_calls (api_calls :list ) -> list :
209
209
from concurrent .futures import ThreadPoolExecutor , as_completed
210
210
output = []
211
- with ThreadPoolExecutor (max_workers = 32 ) as executor :
211
+ with ThreadPoolExecutor (max_workers = 3 ) as executor :
212
212
futures = {executor .submit (get_api , api_call ):api_call for api_call in api_calls }
213
213
214
214
for future in as_completed (futures ):
215
215
url = futures [future ]
216
216
response = future .result ()
217
217
if not len (response ) == 0 :
218
218
output .append ({"url" :url ,"response" :response })
219
- else :
220
- print (f"Empty response for url: { url } " )
219
+ if len (output ) % 1000 == 0 :
220
+ print (f'MILESTONE { len (output )} ' )
221
+ # else:
222
+ # print(f"Empty response for url: {url}")
221
223
return output
You can’t perform that action at this time.
0 commit comments