mirror of
https://github.com/zvx-echo6/meshai.git
synced 2026-06-11 09:24:44 +02:00
feat: add reminders_wfigs.enabled kill switch, default disabled
Adds (reminders_wfigs, enabled) to REGISTRY (default=False) and gates _tick_adapter() on the flag — when false, wfigs fire reminders are skipped entirely. Use the digest instead. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
8e810d6e83
commit
376b0dbb2d
2 changed files with 15 additions and 0 deletions
|
|
@ -487,6 +487,11 @@ REGISTRY: dict[tuple[str, str], dict[str, Any]] = {
|
||||||
# =================================================================
|
# =================================================================
|
||||||
# v0.6-phase3 reminders: per-adapter clock-driven re-broadcast config.
|
# v0.6-phase3 reminders: per-adapter clock-driven re-broadcast config.
|
||||||
# =================================================================
|
# =================================================================
|
||||||
|
("reminders_wfigs", "enabled"): {
|
||||||
|
"default": False,
|
||||||
|
"type": "bool",
|
||||||
|
"description": "Enable Active: reminder broadcasts for ongoing fires. Disabled by default — use the digest instead.",
|
||||||
|
},
|
||||||
("reminders_wfigs", "cadence_kind"): {
|
("reminders_wfigs", "cadence_kind"): {
|
||||||
"default": "interval",
|
"default": "interval",
|
||||||
"type": "str",
|
"type": "str",
|
||||||
|
|
|
||||||
|
|
@ -117,6 +117,16 @@ class ReminderScheduler:
|
||||||
|
|
||||||
async def _tick_adapter(self, adapter: str) -> int:
|
async def _tick_adapter(self, adapter: str) -> int:
|
||||||
"""Look up the reminder config + query the adapter's table."""
|
"""Look up the reminder config + query the adapter's table."""
|
||||||
|
# Per-adapter kill switch: adapter_config reminders_<name>.enabled
|
||||||
|
try:
|
||||||
|
from meshai.adapter_config import adapter_config
|
||||||
|
ac_adapter = f"reminders_{adapter}"
|
||||||
|
enabled = _safe_get(adapter_config, ac_adapter, "enabled")
|
||||||
|
if enabled is not None and not enabled:
|
||||||
|
return 0
|
||||||
|
except Exception:
|
||||||
|
pass
|
||||||
|
|
||||||
cfg = _ReminderConfig.load(adapter)
|
cfg = _ReminderConfig.load(adapter)
|
||||||
if cfg is None:
|
if cfg is None:
|
||||||
return 0
|
return 0
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue