Coverage for /usr/local/lib/python3.12/site-packages/prefect/settings/models/worker.py: 100%
14 statements
« prev ^ index » next coverage.py v7.10.6, created at 2025-12-05 13:38 +0000
« prev ^ index » next coverage.py v7.10.6, created at 2025-12-05 13:38 +0000
1from typing import ClassVar 1a
3from pydantic import Field 1a
4from pydantic_settings import SettingsConfigDict 1a
6from prefect.settings.base import PrefectBaseSettings, build_settings_config 1a
9class WorkerWebserverSettings(PrefectBaseSettings): 1a
10 model_config: ClassVar[SettingsConfigDict] = build_settings_config( 1a
11 ("worker", "webserver")
12 )
14 host: str = Field( 1a
15 default="0.0.0.0",
16 description="The host address the worker's webserver should bind to.",
17 )
19 port: int = Field( 1a
20 default=8080,
21 description="The port the worker's webserver should bind to.",
22 )
25class WorkerSettings(PrefectBaseSettings): 1a
26 model_config: ClassVar[SettingsConfigDict] = build_settings_config(("worker",)) 1a
28 heartbeat_seconds: float = Field( 1a
29 default=30,
30 description="Number of seconds a worker should wait between sending a heartbeat.",
31 )
33 query_seconds: float = Field( 1a
34 default=10,
35 description="Number of seconds a worker should wait between queries for scheduled work.",
36 )
38 prefetch_seconds: float = Field( 1a
39 default=10,
40 description="The number of seconds into the future a worker should query for scheduled work.",
41 )
43 webserver: WorkerWebserverSettings = Field( 1a
44 default_factory=WorkerWebserverSettings,
45 description="Settings for a worker's webserver",
46 )