File tree Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -89,14 +89,19 @@ def __init__(
8989 task_queue ,
9090 max_workers : int = 10 ,
9191 max_concurrent_activities : int = 10 ,
92- health_check_port : int = 80 ,
92+ health_check_port : int | None = None ,
9393 ):
9494 self .task_queue = task_queue
9595 self .activity_handles = []
9696 self .max_workers = max_workers
9797 self .max_concurrent_activities = max_concurrent_activities
9898 self .health_check_server_running = False
9999 self .healthy = False
100+
101+ # Use environment variable if health_check_port not explicitly provided
102+ if health_check_port is None :
103+ health_check_port = int (os .environ .get ("HEALTH_CHECK_PORT" , "80" ))
104+
100105 self .health_check_port = health_check_port
101106
102107 @overload
Original file line number Diff line number Diff line change @@ -32,6 +32,8 @@ class EnvVarKeys(str, Enum):
3232 # Workflow Configuration
3333 WORKFLOW_NAME = "WORKFLOW_NAME"
3434 WORKFLOW_TASK_QUEUE = "WORKFLOW_TASK_QUEUE"
35+ # Temporal Worker Configuration
36+ HEALTH_CHECK_PORT = "HEALTH_CHECK_PORT"
3537 # Auth Configuration
3638 AUTH_PRINCIPAL_B64 = "AUTH_PRINCIPAL_B64"
3739
@@ -62,6 +64,9 @@ class EnvironmentVariables(BaseModel):
6264 # Workflow Configuration
6365 WORKFLOW_TASK_QUEUE : str | None = None
6466 WORKFLOW_NAME : str | None = None
67+ # Temporal Worker Configuration
68+ HEALTH_CHECK_PORT : int = 80
69+ # Auth Configuration
6570 AUTH_PRINCIPAL_B64 : str | None = None
6671
6772 @classmethod
You can’t perform that action at this time.
0 commit comments