Add mq-client to the 'Versions' response
Signed-off-by: Fred Boniface <fred@fjla.uk>
This commit is contained in:
parent
159c46c4cc
commit
babd4563dc
@ -12,7 +12,7 @@ async function get(req, res, next) { // API V1
|
|||||||
|
|
||||||
async function versions(req, res, next) { // API v2
|
async function versions(req, res, next) { // API v2
|
||||||
try {
|
try {
|
||||||
res.json(await stat.versions());
|
res.json(await stat.getVersions());
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.error('Controller Error', err);
|
console.error('Controller Error', err);
|
||||||
err.status = 500;
|
err.status = 500;
|
||||||
|
@ -40,17 +40,16 @@ async function hits(){
|
|||||||
return out;
|
return out;
|
||||||
}
|
}
|
||||||
|
|
||||||
async function versions() {
|
async function getVersions() {
|
||||||
log.out('statsServices.versions: Fetching versions', 'info');
|
log.out('statsServices.getVersions: Fetching versions', 'info');
|
||||||
const versions = await db.query('meta', {target: 'versions'});
|
const dbMan = await db.query('versions', {target: 'dbmanager'});
|
||||||
let data = {
|
const mqClt = await db.query('versions', {target: 'mq-client'});
|
||||||
backend: '',
|
const data = {
|
||||||
'db-manager': '',
|
'backend': vers.app,
|
||||||
'mq-subscriber': '',
|
'db-manager': dbMan[0]?.['version'] || '',
|
||||||
};
|
'mq-client': mqClt[0]?.['version'] || '',
|
||||||
data.backend = vers.app;
|
}
|
||||||
data['db-manager'] = versions[0]['dbmanager'];
|
return data
|
||||||
return data;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async function statistics() {
|
async function statistics() {
|
||||||
@ -133,5 +132,6 @@ async function statistics() {
|
|||||||
module.exports = {
|
module.exports = {
|
||||||
hits,
|
hits,
|
||||||
versions,
|
versions,
|
||||||
statistics
|
statistics,
|
||||||
|
getVersions
|
||||||
};
|
};
|
Loading…
Reference in New Issue
Block a user