Skip to content

Commit

Permalink
ttl
Browse files Browse the repository at this point in the history
  • Loading branch information
jschlyter committed Dec 22, 2024
1 parent 01016ae commit bac0983
Showing 1 changed file with 22 additions and 5 deletions.
27 changes: 22 additions & 5 deletions nodeman/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,23 @@
from typing import Annotated, Self

from argon2 import PasswordHasher
from pydantic import AnyHttpUrl, BaseModel, Field, FilePath, StringConstraints, UrlConstraints, model_validator
from pydantic_core import Url
from pydantic_settings import BaseSettings, PydanticBaseSettingsSource, SettingsConfigDict, TomlConfigSettingsSource

from dnstapir.opentelemetry import OtlpSettings
from pydantic import (
AnyHttpUrl,
BaseModel,
Field,
FilePath,
StringConstraints,
UrlConstraints,
model_validator,
)
from pydantic_core import Url
from pydantic_settings import (
BaseSettings,
PydanticBaseSettingsSource,
SettingsConfigDict,
TomlConfigSettingsSource,
)

MqttUrl = Annotated[
Url,
Expand Down Expand Up @@ -45,7 +57,12 @@ class NodesSettings(BaseModel):
trusted_jwks: FilePath | None = Field(default=None)
mqtt_broker: MqttUrl = Field(default="mqtt://localhost")
mqtt_topics: dict[str, str] = Field(default={})
configuration_ttl: int = Field(default=300)
configuration_ttl: int = Field(
default=300,
gt=0,
le=86400,
description="Configuration cache TTL in seconds",
)


class User(BaseModel):
Expand Down

0 comments on commit bac0983

Please sign in to comment.