Commit d4b4a59
committed
fix: make service ready timeout configurable via env var
The DefaultServiceTimeout constant is hard-coded to 5 seconds, which
causes the inspect-server (and occasionally other services) to be killed
by the supervisor before they finish initialising on slow or
resource-constrained environments such as fly.io.
Replace the constant with a package-level var that reads
CARTESI_SERVICE_READY_TIMEOUT from the environment at process start.
The value must be a valid Go duration string (e.g. "30s", "1m").
If the variable is absent or invalid the original 5-second default is
preserved, so the change is fully backward-compatible.
Tested on fly.io: inspect-server takes ~21 s to become ready; with
CARTESI_SERVICE_READY_TIMEOUT=30s all services report ready and the
node runs normally.1 parent 0e65d06 commit d4b4a59
1 file changed
Lines changed: 11 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
10 | 11 | | |
11 | 12 | | |
12 | 13 | | |
13 | 14 | | |
14 | 15 | | |
15 | | - | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
16 | 26 | | |
17 | 27 | | |
18 | 28 | | |
| |||
0 commit comments