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