fix: health returns 200 for degraded, probe tolerant of optional services
Build Institutional Trader / build-and-deploy (push) Successful in 2m2s
Details
Build Institutional Trader / build-and-deploy (push) Successful in 2m2s
Details
This commit is contained in:
parent
911693da88
commit
78b408057c
|
|
@ -102,7 +102,8 @@ router.get('/', async (req, res) => {
|
|||
};
|
||||
}
|
||||
|
||||
const statusCode = health.status === 'ok' ? 200 : 503;
|
||||
// Only return 503 if the server itself is broken — degraded means optional services are down
|
||||
const statusCode = health.status === 'error' ? 503 : 200;
|
||||
res.status(statusCode).json(health);
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -26,14 +26,16 @@ spec:
|
|||
httpGet:
|
||||
path: /health
|
||||
port: 3010
|
||||
initialDelaySeconds: 15
|
||||
initialDelaySeconds: 30
|
||||
periodSeconds: 20
|
||||
failureThreshold: 5
|
||||
readinessProbe:
|
||||
httpGet:
|
||||
path: /health
|
||||
port: 3010
|
||||
initialDelaySeconds: 5
|
||||
initialDelaySeconds: 15
|
||||
periodSeconds: 10
|
||||
failureThreshold: 6
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
|
|
|
|||
Loading…
Reference in New Issue