verdict_ttl
verdict_ttl
¶
The grammar of clearance.verdict_ttl: how long an unanswered verdict stays pending.
One definition serves both readers of the key. The hub parses the value
that it finds in config.yml, and
RawClearanceSection
validates the value with the same function, so what a composed schema
accepts is what the hub honours. The two see the value differently:
terok-util's layered reader hands the hub every value as text, while a
schema validates the parsed YAML, where a number is still a number. The
parser therefore takes both.
The module imports nothing beyond the standard library, because each reader must stay free of the other's dependencies: the hub of pydantic, the schema of the varlink stack.
DEFAULT_VERDICT_TTL = 24 * 3600.0
module-attribute
¶
parse_verdict_ttl(value)
¶
Parse a TTL into seconds, or None for "no expiry".
Accepts plain seconds (3600, as text or as the number YAML makes
of it), unit-suffixed (24h, 30m, 7d), and the special
values never / none (both meaning "no expiry"). A zero
duration (0, 0.0, 0s) also means "no expiry": a pending
verdict that expires at once is never what an operator asks for.
None input returns the default (24h).
Raises ValueError on malformed input.