Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion src/agentex/lib/core/temporal/workers/worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,14 +89,19 @@ def __init__(
task_queue,
max_workers: int = 10,
max_concurrent_activities: int = 10,
health_check_port: int = 80,
health_check_port: int | None = None,
):
self.task_queue = task_queue
self.activity_handles = []
self.max_workers = max_workers
self.max_concurrent_activities = max_concurrent_activities
self.health_check_server_running = False
self.healthy = False

# Use environment variable if health_check_port not explicitly provided
if health_check_port is None:
health_check_port = int(os.environ.get("HEALTH_CHECK_PORT", "80"))

self.health_check_port = health_check_port

@overload
Expand Down
5 changes: 5 additions & 0 deletions src/agentex/lib/environment_variables.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ class EnvVarKeys(str, Enum):
# Workflow Configuration
WORKFLOW_NAME = "WORKFLOW_NAME"
WORKFLOW_TASK_QUEUE = "WORKFLOW_TASK_QUEUE"
# Temporal Worker Configuration
HEALTH_CHECK_PORT = "HEALTH_CHECK_PORT"
# Auth Configuration
AUTH_PRINCIPAL_B64 = "AUTH_PRINCIPAL_B64"

Expand Down Expand Up @@ -62,6 +64,9 @@ class EnvironmentVariables(BaseModel):
# Workflow Configuration
WORKFLOW_TASK_QUEUE: str | None = None
WORKFLOW_NAME: str | None = None
# Temporal Worker Configuration
HEALTH_CHECK_PORT: int = 80
# Auth Configuration
AUTH_PRINCIPAL_B64: str | None = None

@classmethod
Expand Down
Loading