修复今日最高:新增 city_daily_max 表,所有数据源写入日最高
- DB: city_daily_max(icao,max_temp,obs_date,max_time) upsert - AMOS/JMA/KNMI/FMI/HKO/METAR集群/CWA 采集后均写入 - Rust: 读 city_daily_max 获取准确日最高 + 时间 - 卡片恢复 High 行,显示最高温 + 达成时间 - new_high 提醒也基于真实日最高重新生效 Tested: cargo build + ruff check 均通过
This commit is contained in:
@@ -377,6 +377,17 @@ class SettlementSourceMixin:
|
||||
)
|
||||
except Exception:
|
||||
logger.exception("airport_obs_log append failed for cwa")
|
||||
try:
|
||||
from src.database.db_manager import DBManager
|
||||
today = datetime.now().strftime("%Y-%m-%d")
|
||||
tc = payload["current"]["temp"]
|
||||
if tc is not None:
|
||||
DBManager().upsert_daily_max(
|
||||
icao="466920", temp_c=tc, obs_date=today,
|
||||
obs_time=str(obs_time_raw or "").strip(),
|
||||
)
|
||||
except Exception:
|
||||
pass
|
||||
return payload
|
||||
except Exception as exc:
|
||||
logger.warning(f"CWA settlement fetch failed: {exc}")
|
||||
|
||||
Reference in New Issue
Block a user