rename getServices to getServiceIds

This commit is contained in:
Girish Ramakrishnan
2021-01-21 12:38:12 -08:00
parent 304fe45ee8
commit d294dea84d
2 changed files with 6 additions and 8 deletions
+1 -3
View File
@@ -16,9 +16,7 @@ const assert = require('assert'),
services = require('../services.js');
function getAll(req, res, next) {
req.clearTimeout(); // can take a while to get status of all services
services.getServices(function (error, result) {
services.getServiceIds(function (error, result) {
if (error) return next(BoxError.toHttpError(error));
next(new HttpSuccess(200, { services: result }));
+5 -5
View File
@@ -1,7 +1,7 @@
'use strict';
exports = module.exports = {
getServices,
getServiceIds,
getService,
getServiceConfig,
configureService,
@@ -347,19 +347,19 @@ function containerStatus(containerName, tokenEnvName, callback) {
});
}
function getServices(callback) {
function getServiceIds(callback) {
assert.strictEqual(typeof callback, 'function');
let services = Object.keys(SERVICES);
let serviceIds = Object.keys(SERVICES);
appdb.getAll(function (error, apps) {
if (error) return callback(error);
for (let app of apps) {
if (app.manifest.addons && app.manifest.addons['redis']) services.push(`redis:${app.id}`);
if (app.manifest.addons && app.manifest.addons['redis']) serviceIds.push(`redis:${app.id}`);
}
callback(null, services);
callback(null, serviceIds);
});
}