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