Files
checkbot/app/poller/options.py
T
patrickandClaude Sonnet 5.5 5278530467
test / pytest (3.11) (push) Waiting to run
test / pytest (3.13) (push) Waiting to run
feat: Phase 6b rules with delay, delta format, reminders, zpool default rule
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-06 02:38:10 +01:00

22 lines
673 B
Python

from dataclasses import dataclass
from ..constants import (ALERTS_DEFAULT_DELAY_MINUTES, DEFAULT_DELAY_MINUTES, DEFAULT_POLL_INTERVAL,
MAX_DELAY_MINUTES, MIN_POLL_INTERVAL, POLL_INTERVAL)
@dataclass(frozen=True)
class PollOptions:
interval: int
default_delay_minutes: int
def read_default_delay(store) -> int:
return min(store.get_int(ALERTS_DEFAULT_DELAY_MINUTES, DEFAULT_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),
)