chore: add ipStatus to /live endpoint

This commit is contained in:
WebStreamr 2025-09-03 10:29:00 +00:00
parent 83021fb773
commit 94abcd3f0a
No known key found for this signature in database

View file

@ -131,12 +131,11 @@ addon.get('/live', async (req: Request, res: Response) => {
if (blockedCount > 0) {
// TODO: fail health check and try to get a clean IP if infra is ready
logger.warn('IP might be not clean and leading to blocking.', ctx);
}
if (errorCount === sources.length) {
res.json({ status: 'ok', ipStatus: 'error' });
} else if (errorCount === sources.length) {
res.status(503).json({ status: 'error' });
} else {
res.json({ status: 'ok' });
res.json({ status: 'ok', ipStatus: 'ok' });
}
});