Improve timestamp handling and event navigation

This commit is contained in:
Stanislav Rossovskii
2026-05-27 11:01:27 +04:00
parent edc51e9c59
commit 71f0035b0b
37 changed files with 485 additions and 109 deletions

View File

@@ -1,6 +1,8 @@
from pydantic import field_validator
from pydantic_settings import BaseSettings, SettingsConfigDict
from .timeutil import validate_time_zone
class Settings(BaseSettings):
model_config = SettingsConfigDict(env_prefix="MONLET_", env_file=".env", extra="ignore")
@@ -25,6 +27,7 @@ class Settings(BaseSettings):
notifier_max_attempts: int = 8
notifier_lease_sec: int = 300
notifier_http_timeout_sec: float = 10.0
notification_time_zone: str = "UTC"
notifier_debug_enabled: bool = True
notifier_telegram_enabled: bool = False
@@ -43,6 +46,11 @@ class Settings(BaseSettings):
raise ValueError("MONLET_AUTH_TOKEN must be set to a non-default value")
return value
@field_validator("notification_time_zone")
@classmethod
def _validate_notification_time_zone(cls, value: str) -> str:
return validate_time_zone(value)
@property
def enabled_notifiers(self) -> list[str]:
out: list[str] = []