From d9adc06a9f9d427f87b95d7c107acf7cfa621d61 Mon Sep 17 00:00:00 2001 From: wzy-warehouse <18135009705@163.com> Date: Sun, 14 Jun 2026 16:56:09 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=97=B6=E9=97=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/api/rainfall.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/app/api/rainfall.py b/app/api/rainfall.py index 768dec7..d399a33 100644 --- a/app/api/rainfall.py +++ b/app/api/rainfall.py @@ -86,8 +86,12 @@ def _predict_sync(point_ids: Optional[List[int]], region_code: Optional[str], if not points: return {}, {}, {}, occurred_time or datetime.now() - # 使用传入的时间或当前时间作为查询时间 - query_time = occurred_time or datetime.now() + # 使用传入的时间,如果没有传则使用 rainfall_manager 中的全局查询时间,最后才用当前时间 + if occurred_time: + query_time = occurred_time + else: + from app.core.rainfall_manager import rainfall_manager + query_time = rainfall_manager.get_current_query_time() or datetime.now() model = get_rainfall_model() raw_results = model.predict_multiple_points(points, rainfall=rainfall, duration=duration, query_time=query_time)