minor caching improvement
All checks were successful
continuous-integration/woodpecker the build was successful
All checks were successful
continuous-integration/woodpecker the build was successful
This commit is contained in:
parent
c0940e67fd
commit
915dedb827
1 changed files with 6 additions and 0 deletions
|
@ -79,6 +79,12 @@ api.post('/update/health', (req, res) => {
|
||||||
return res.status(401).send('invalid token');
|
return res.status(401).send('invalid token');
|
||||||
}
|
}
|
||||||
const serviceId = req.query.service as string;
|
const serviceId = req.query.service as string;
|
||||||
|
if (!config.groups
|
||||||
|
.map(g => g.services).reduce((x, y) => x.concat(y), [])
|
||||||
|
.map(s => s.id).includes(serviceId)) {
|
||||||
|
// TODO remove old caches
|
||||||
|
return res.send('OK');
|
||||||
|
}
|
||||||
let services: { id: string, state: string }[] = [];
|
let services: { id: string, state: string }[] = [];
|
||||||
if (serviceId) {
|
if (serviceId) {
|
||||||
services = [{id: serviceId, state: JSONPath({path: serviceStatePaths[serviceId], json: req.body, wrap: false})}];
|
services = [{id: serviceId, state: JSONPath({path: serviceStatePaths[serviceId], json: req.body, wrap: false})}];
|
||||||
|
|
Reference in a new issue