Improve timestamp handling and event navigation
This commit is contained in:
@@ -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] = []
|
||||
|
||||
Reference in New Issue
Block a user