mirror of
https://github.com/yavook/kiwi-simple-metrics.git
synced 2024-11-21 23:32:59 +00:00
more pydantic way of forcing SETTINGS.external.count
to None
This commit is contained in:
parent
71b8fe7454
commit
e1797f61ec
1 changed files with 3 additions and 6 deletions
|
@ -89,14 +89,11 @@ class ExternalMS(MetricSettings):
|
||||||
enabled: bool = False
|
enabled: bool = False
|
||||||
threshold: float = 0
|
threshold: float = 0
|
||||||
|
|
||||||
|
# always include all defined external values!
|
||||||
|
count: None = None
|
||||||
|
|
||||||
# path to executable files
|
# path to executable files
|
||||||
executables: list[FilePath] = []
|
executables: list[FilePath] = []
|
||||||
|
|
||||||
# wait at most this many seconds for each executable
|
# wait at most this many seconds for each executable
|
||||||
timeout: int = 60
|
timeout: int = 60
|
||||||
|
|
||||||
@field_validator("count", mode="after")
|
|
||||||
@classmethod
|
|
||||||
def force_none(cls, _) -> int | None:
|
|
||||||
"""Don't accept a `count` value for the external metric!"""
|
|
||||||
return None
|
|
||||||
|
|
Loading…
Reference in a new issue