Skip to content

Commit 62027fc

Browse files
feat: expose HEALTH_CHECK_PORT as an env var
1 parent 58c7b04 commit 62027fc

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

src/agentex/lib/core/temporal/workers/worker.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff 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

src/agentex/lib/environment_variables.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff 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

@@ -61,8 +63,10 @@ class EnvironmentVariables(BaseModel):
6163
ACP_PORT: int = 8000
6264
# Workflow Configuration
6365
WORKFLOW_TASK_QUEUE: str | None = None
64-
WORKFLOW_NAME: str | None = None
66+
WORKFLOW_NAME: str | None = None
6567
AUTH_PRINCIPAL_B64: str | None = None
68+
# Temporal Worker Configuration
69+
HEALTH_CHECK_PORT: int = 80
6670

6771
@classmethod
6872
def refresh(cls) -> EnvironmentVariables:

0 commit comments

Comments
 (0)