|
|
@@ -126,6 +126,9 @@ def import_flight_range_status(atlas_db, mongo_db, city_pair, create_at_begin_st
|
|
|
upserted += 1
|
|
|
else:
|
|
|
matched += res.matched_count
|
|
|
+
|
|
|
+ if i % 100 == 0:
|
|
|
+ print(f"写入进度 {city_pair} [{i}/{len(results)}]: upserted={upserted}, matched={matched}, failed={write_failed}")
|
|
|
|
|
|
print(f"写入集合: {mongo_table_uo}, upserted={upserted}, matched={matched}, failed={write_failed}, total={len(results)}")
|
|
|
return
|
|
|
@@ -178,21 +181,21 @@ def main_import_process(create_at_begin, create_at_end):
|
|
|
print(f"create_at_begin: {create_at_begin}, timestamp: {create_at_begin_stamp}")
|
|
|
print(f"create_at_end: {create_at_end}, timestamp: {create_at_end_stamp}")
|
|
|
|
|
|
- atlas_client, atlas_db = mongo_con_parse(atlas_config)
|
|
|
- mongo_client, mongo_db = mongo_con_parse(mongo_config)
|
|
|
for idx, city_pair in enumerate(uo_city_pairs):
|
|
|
+ atlas_client, atlas_db = mongo_con_parse(atlas_config)
|
|
|
+ mongo_client, mongo_db = mongo_con_parse(mongo_config)
|
|
|
print(f"开始处理航线 {idx+1}/{len(uo_city_pairs)}: {city_pair}")
|
|
|
import_flight_range_status(atlas_db, mongo_db, city_pair, create_at_begin_stamp, create_at_end_stamp)
|
|
|
print(f"结束处理航线 {idx+1}/{len(uo_city_pairs)}: {city_pair}")
|
|
|
- atlas_client.close()
|
|
|
- mongo_client.close()
|
|
|
+ atlas_client.close()
|
|
|
+ mongo_client.close()
|
|
|
pass
|
|
|
print("整体结束")
|
|
|
print()
|
|
|
|
|
|
if __name__ == "__main__":
|
|
|
- create_at_begin = "2026-02-18 00:00:00"
|
|
|
- create_at_end = "2026-02-28 23:59:59"
|
|
|
+ create_at_begin = "2026-03-11 00:00:00"
|
|
|
+ create_at_end = "2026-03-20 23:59:59"
|
|
|
main_import_process(create_at_begin, create_at_end)
|
|
|
|
|
|
# try:
|