Files
patrickandClaude Sonnet 5.5 347f55cf7c
test / pytest (3.11) (push) Canceled after 0s
test / pytest (3.13) (push) Canceled after 0s
feat: Phase 6c baseline, ack, host alarms, outage notice, send limit, privacy mode, UI link
Includes atomic migrations, per-rule reminder semantics, first-run helper script
and the note on the undecided UI chat idea.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-06 03:06:23 +01:00

29 lines
1002 B
Python

from dataclasses import dataclass
from ..constants import (ALERTS_DEFAULT_DELAY_MINUTES, ALERTS_HOST_DELAY_MINUTES, DEFAULT_DELAY_MINUTES,
DEFAULT_HOST_DELAY_MINUTES, DEFAULT_POLL_INTERVAL, MAX_DELAY_MINUTES, MIN_POLL_INTERVAL,
POLL_INTERVAL)
@dataclass(frozen=True)
class PollOptions:
interval: int
default_delay_minutes: int
host_delay_minutes: int = DEFAULT_HOST_DELAY_MINUTES
def read_default_delay(store) -> int:
return min(store.get_int(ALERTS_DEFAULT_DELAY_MINUTES, DEFAULT_DELAY_MINUTES), MAX_DELAY_MINUTES)
def read_host_delay(store) -> int:
return min(store.get_int(ALERTS_HOST_DELAY_MINUTES, DEFAULT_HOST_DELAY_MINUTES), MAX_DELAY_MINUTES)
def read_poll_options(store) -> PollOptions:
return PollOptions(
interval=store.get_int(POLL_INTERVAL, DEFAULT_POLL_INTERVAL, MIN_POLL_INTERVAL),
default_delay_minutes=read_default_delay(store),
host_delay_minutes=read_host_delay(store),
)