fix critical health check

This commit is contained in:
Karol Wypchlo 2021-06-18 12:57:44 +02:00
parent fbdae038df
commit dd02215292
1 changed files with 8 additions and 8 deletions

View File

@ -70,23 +70,23 @@ async function directServerApiAccessCheck(done) {
return done({ up: false, info: { message: "SKYNET_SERVER_API env variable not configured" } }); return done({ up: false, info: { message: "SKYNET_SERVER_API env variable not configured" } });
} }
const [domainAccessCheck, directAccessCheck] = await Promise.all([ const [portalAccessCheck, serverAccessCheck] = await Promise.all([
genericAccessCheck("portal_api_access", process.env.SKYNET_PORTAL_API), genericAccessCheck("portal_api_access", process.env.SKYNET_PORTAL_API),
genericAccessCheck("direct_server_api_access", process.env.SKYNET_SERVER_API), genericAccessCheck("server_api_access", process.env.SKYNET_SERVER_API),
]); ]);
if (domainAccessCheck.ip !== directAccessCheck.ip) { if (portalAccessCheck.ip !== serverAccessCheck.ip) {
directAccessCheck.up = false; serverAccessCheck.up = false;
directAccessCheck.info = { serverAccessCheck.info = {
message: "Access ip mismatch between domain and direct access", message: "Access ip mismatch between domain and direct access",
response: { response: {
domain: { name: process.env.SKYNET_PORTAL_API, ip: domainAccessCheck.ip }, portal: { name: process.env.SKYNET_PORTAL_API, ip: portalAccessCheck.ip },
domain: { name: process.env.SKYNET_SERVER_API, ip: directAccessCheck.ip }, server: { name: process.env.SKYNET_SERVER_API, ip: serverAccessCheck.ip },
}, },
}; };
} }
return done(directAccessCheck); return done(serverAccessCheck);
} }
// accountHealthCheck returns the result of accounts service health checks // accountHealthCheck returns the result of accounts service health checks