optimize check_results.py

This commit is contained in:
Lei PAN
2022-05-27 22:32:07 +02:00
parent ae01db56fe
commit f303c33752
+2 -3
View File
@@ -116,11 +116,10 @@ if __name__ == '__main__':
reserve_pojo = ReserveResultPojo.from_firestore_dict(appointment.to_dict()) reserve_pojo = ReserveResultPojo.from_firestore_dict(appointment.to_dict())
result_list.append(reserve_pojo) result_list.append(reserve_pojo)
with ThreadPoolExecutor(max_workers=5) as executor: with ThreadPoolExecutor(max_workers=20) as executor:
for reserve in result_list: for reserve in result_list:
count = count + 1 count = count + 1
if reserve.accepted is None: if reserve.accepted is None or ResultEnum.PENDING.value == reserve.accepted:
# or ResultEnum.PENDING.value == reserve.accepted:
if reserve.url != BLANK_URL: if reserve.url != BLANK_URL:
executor.submit(ResultChecker().run, reserve, collection) executor.submit(ResultChecker().run, reserve, collection)
else: else: