anweiguo 3 veckor sedan
förälder
incheckning
418eeabbf9
1 ändrade filer med 3 tillägg och 1 borttagningar
  1. 3 1
      data_processing/data_operation/data_nwp_ftp.py

+ 3 - 1
data_processing/data_operation/data_nwp_ftp.py

@@ -242,10 +242,12 @@ def get_nwp_from_ftp():
         logger.info("从日期{}时刻{}开始查找文件".format(date, moment))
         success = select_file_to_mongo(args, date, moment)
         new_date = date
-        while not success and date == new_date:
+        i = 1
+        while not success and date == new_date and i <= 2:
             new_date, moment = get_previous_moment(date, moment)
             logger.info("未找到,从日期{}时刻{}开始查找文件".format(new_date, moment))
             success = select_file_to_mongo(args, new_date, moment)
+            i += 1
     except Exception as e:
         my_exception = traceback.format_exc()
         my_exception.replace("\n", "\t")