新增机场高频推送:10分钟级温度监控 + DEB预测快报

为首尔/釜山/东京三大机场城市实现高频温度监控通道:
- 新增 airport_obs_log 表积累观测数据,支持趋势检测
- AMOS/JMA 成功后自动写入观测日志
- 新增 airport_rapid_temp_change 告警规则(20min窗口、0.5°C/10min阈值)
- 10分钟间隔高频子循环 + 30分钟机场快照(含 DEB 预测最高温)
- 最高温锁定后自动跳过,快照仅当地 08:00-20:00 发送

Tested: ruff check 通过
@
This commit is contained in:
2569718930@qq.com
2026-05-12 17:04:17 +08:00
parent ff4c8b0139
commit 64f8ff21ec
6 changed files with 496 additions and 25 deletions
+25
View File
@@ -84,6 +84,7 @@ class StartupCoordinator:
def start_all(self) -> RuntimeStatus:
loops = [
self._start_trade_alert_loop(),
self._start_airport_high_freq_loop(),
self._start_dashboard_prewarm_loop(),
self._start_polygon_wallet_loop(),
self._start_polymarket_wallet_activity_loop(),
@@ -182,6 +183,30 @@ class StartupCoordinator:
),
)
def _start_airport_high_freq_loop(self) -> LoopStatus:
enabled = _env_bool("TELEGRAM_AIRPORT_PUSH_ENABLED", True)
chat_ids = get_telegram_chat_ids_from_env()
interval = max(60, _env_int("TELEGRAM_AIRPORT_PUSH_INTERVAL_SEC", 600))
details = {
"mode": "airport-high-freq",
"interval_sec": interval,
"cities": ["seoul", "busan", "tokyo"],
"chat_targets": len(chat_ids),
"cooldown_sec": _env_int("TELEGRAM_AIRPORT_COOLDOWN_SEC", 7200),
}
validation_error = None if chat_ids else "missing_TELEGRAM_CHAT_IDS"
return self._start_with_validation(
key="airport_high_freq_push",
label="机场高频推送",
configured_enabled=enabled,
details=details,
validation_error=validation_error,
starter=lambda: import_module("src.utils.telegram_push").start_high_freq_airport_push_loop(
self.bot,
self.config,
),
)
def _start_dashboard_prewarm_loop(self) -> LoopStatus:
enabled = _env_bool("POLYWEATHER_DASHBOARD_PREWARM_ENABLED", False)
interval = max(30, _env_int("POLYWEATHER_PREWARM_INTERVAL_SEC", 300))