Expand description
Hot configuration reload.
Re-reads rws.config.toml without restarting the server. Non-binding
settings — those that would require a new TCP socket (IP, port,
thread count) or a new TLS acceptor (cert/key paths) — are logged as
ignored. All other settings take effect on the next incoming request.
§Triggering a reload
- Unix signal: send
SIGHUPto the server process.kill -HUP $(pidof rws) - HTTP endpoint:
POST /admin/config/reload(no body required).
§What is hot-reloadable
| Setting | Env var |
|---|---|
| CORS — all fields | RWS_CONFIG_CORS_* |
| Rate-limit thresholds | RWS_CONFIG_RATE_LIMIT_MAX_REQUESTS, RWS_CONFIG_RATE_LIMIT_WINDOW_SECS |
| Log format | RWS_CONFIG_LOG_FORMAT |
| Request allocation size | RWS_CONFIG_REQUEST_ALLOCATION_SIZE_IN_BYTES |
§What is NOT hot-reloadable (requires restart)
| Setting | Why |
|---|---|
| IP / Port | Bound socket cannot be moved |
| Thread count | Thread pool is fixed at startup |
| TLS cert / key | TLS acceptor is built once at startup |
Structs§
- Config
Snapshot - Snapshot of all hot-reloadable configuration values at a point in time.
Statics§
- RELOAD_
REQUESTED - Global flag set by the SIGHUP signal handler.
Functions§
- current
- Returns a clone of the current hot-reloadable configuration snapshot.
- install_
sighup_ handler - Install a
SIGHUPsignal handler that setsRELOAD_REQUESTED. - reload
- Re-read
rws.config.tomland apply all hot-reloadable changes in-place.