Add worker health endpoints

This commit is contained in:
Grendgi
2026-06-09 11:38:03 +03:00
parent 0e2c267053
commit 01ee090fa5
5 changed files with 131 additions and 0 deletions

View File

@@ -26,6 +26,8 @@ type Config struct {
AIStatsTimeout time.Duration
WorkerID string
WorkerHTTPHost string
WorkerHTTPPort int
WorkerPollInterval time.Duration
WorkerClaimLimit int
WorkerLeaseTimeout time.Duration
@@ -53,6 +55,8 @@ func Load() Config {
AIStatsTimeout: envDuration("AI_STATS_TIMEOUT", 8*time.Second),
WorkerID: envString("WORKER_ID", hostname()),
WorkerHTTPHost: envString("WORKER_HTTP_HOST", "0.0.0.0"),
WorkerHTTPPort: envInt("WORKER_HTTP_PORT", 8081),
WorkerPollInterval: envDuration("WORKER_POLL_INTERVAL", 2*time.Second),
WorkerClaimLimit: envInt("WORKER_CLAIM_LIMIT", 4),
WorkerLeaseTimeout: envDuration("WORKER_LEASE_TIMEOUT", 15*time.Minute),