newStaffLDB-API #48

Merged
fred.boniface merged 85 commits from newStaffLDB-API into main 2023-10-03 21:35:03 +01:00
1 changed files with 5 additions and 5 deletions
Showing only changes of commit dc9a5e15da - Show all commits

View File

@ -1,8 +1,9 @@
const log = require("../utils/logs.utils"); // Log Helper
const db = require("../services/dbAccess.services");
const os = require("os");
const vers = require("../configs/version.configs");
import { logger } from "../utils/logger.utils";
async function buildJson() {
let json = {};
json.count = {};
@ -34,14 +35,13 @@ async function buildJson() {
}
async function hits() {
log.out("statsServices.hits: Statistics Requested", "info");
logger.debug("statsServices.hits: Statistics Requested");
const out = await buildJson();
log.out(`statsServices.hits: Sending Data: ${JSON.stringify(out)}`, "info");
return out;
}
async function getVersions() {
log.out("statsServices.getVersions: Fetching versions", "info");
logger.debug("statsServices.getVersions: Fetching versions");
const dbMan = await db.query("versions", { target: "dbmanager" });
const mqClt = await db.query("versions", { target: "mq-client" });
const data = {
@ -53,7 +53,7 @@ async function getVersions() {
}
async function statistics() {
log.out("statsServices.statistics: Fetching statistics", "info");
logger.debug("statsServices.statistics: Fetching statistics");
const countersPromise = db.query("meta", { target: "counters" });
const timetablePromise = db.query("meta", { target: "timetable" });