feat: Implement a Telegram push notification system for weather trade alerts, including state management, cooldowns, and severity filtering.
This commit is contained in:
@@ -254,6 +254,10 @@ def start_trade_alert_push_loop(bot: Any, config: Dict[str, Any]) -> Optional[th
|
|||||||
state_path = _state_file()
|
state_path = _state_file()
|
||||||
|
|
||||||
def _runner() -> None:
|
def _runner() -> None:
|
||||||
|
try:
|
||||||
|
_save_state(state_path, _load_state(state_path))
|
||||||
|
except Exception:
|
||||||
|
logger.exception(f"failed to initialize telegram push state path={state_path}")
|
||||||
logger.info(
|
logger.info(
|
||||||
f"telegram alert push loop started cities={len(cities)} interval={interval_sec}s "
|
f"telegram alert push loop started cities={len(cities)} interval={interval_sec}s "
|
||||||
f"cooldown={cooldown_sec}s min_triggers={min_trigger_count} min_severity={min_severity} "
|
f"cooldown={cooldown_sec}s min_triggers={min_trigger_count} min_severity={min_severity} "
|
||||||
|
|||||||
Reference in New Issue
Block a user