mirror of
https://code.lenaisten.de/Lenaisten/advent22.git
synced 2026-02-25 02:20:17 +00:00
🧹 production script: use pydantic constrained integers
This commit is contained in:
parent
09b9886ee7
commit
7b65d8c9b5
1 changed files with 4 additions and 4 deletions
|
|
@ -2,14 +2,14 @@ import os
|
|||
|
||||
from granian import Granian
|
||||
from granian.constants import Interfaces, Loops
|
||||
from pydantic import BaseModel, Field
|
||||
from pydantic import BaseModel, PositiveInt
|
||||
from pydantic_settings import BaseSettings, SettingsConfigDict
|
||||
|
||||
|
||||
class WorkersSettings(BaseModel):
|
||||
per_core: int = Field(1, ge=1)
|
||||
max: int | None = Field(None, ge=1)
|
||||
exact: int | None = Field(None, ge=1)
|
||||
per_core: PositiveInt = 1
|
||||
max: PositiveInt | None = None
|
||||
exact: PositiveInt | None = None
|
||||
|
||||
@property
|
||||
def count(self) -> int:
|
||||
|
|
|
|||
Loading…
Reference in a new issue