Module: Wurk::Health

Defined in:
lib/wurk/health.rb

Overview

Thin HTTP listener for k8s liveness/readiness probes. Optional, off by default — opt in with ‘config.health_check(port: 7433)`.

Endpoints:

* GET /live  → 200 while the Launcher is running (not in quiet/stop).
* GET /ready → 200 only when Redis is reachable AND the heartbeat has
               fired within `ready_window` seconds. 503 otherwise.

Anything else returns 404 JSON.

The server uses a raw TCPServer and one accept thread. No Rack, no dependencies — it lives inside every worker process where Rails may or may not exist (standalone CLI, Embedded, swarm child). Bound to a dedicated port so it does not collide with the host application’s HTTP.

Spec: docs/target/sidekiq-ent.md §7.1.2 (‘config.health_check`).

Defined Under Namespace

Classes: Server

Constant Summary collapse

DEFAULT_PORT =
7433
DEFAULT_BIND =
'0.0.0.0'
DEFAULT_READY_WINDOW =
30