Commit 182317f
committed
fix(redis): throw on missing scheme instead of silently falling back to 127.0.0.1
parseRedisUrl previously defaulted to host '127.0.0.1' when u.hostname was
empty — which happens silently when REDIS_URL lacks the redis:// scheme prefix.
Inside Docker 127.0.0.1 refers to the container itself, not the Redis service,
causing ECONNREFUSED and deployment rollbacks.
Changes:
- Validate that REDIS_URL starts with redis:// or rediss:// at startup
- Throw a clear, actionable error message if the scheme is missing
- Remove the silent 127.0.0.1 fallback entirely
The production .env on the VPS must be updated to:
REDIS_URL=redis://<host>:<port>1 parent 9b32349 commit 182317f
1 file changed
Lines changed: 10 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
22 | 31 | | |
23 | 32 | | |
24 | 33 | | |
25 | | - | |
| 34 | + | |
26 | 35 | | |
27 | 36 | | |
28 | 37 | | |
| |||
0 commit comments