Skip to content

Commit 51d8d98

Browse files
committed
Refactored mongo.health function further
Moved the metrics model find function inside the health metrics function so that the data from the metrics model is populated before the length check between the current metrics and the health metrics
1 parent 3ceb4c0 commit 51d8d98

2 files changed

Lines changed: 2 additions & 6 deletions

File tree

chronos_npm_package/chronos.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,11 +70,9 @@ class Chronos {
7070
* endpoint that the user Request travels through (tracked with hpropograte) for express routes
7171
*/
7272
if (database.type === 'MongoDB') {
73-
//MONGO IS NOT ACTUAL MONGO, its a separate function imported from the controllers file
74-
console.log("MIKE YOOOOOOOOOOO",this.config);
73+
//mongo is referring to controller function defined locally, not the actual mongodb object
7574
mongo.connect(this.config);
7675
mongo.services(this.config);
77-
// console.log('dockerized really? chronos.js LN 75', dockerized, this.config)
7876
dockerized ? mongo.docker(this.config) : mongo.health(this.config);
7977

8078
if (database.connection === 'REST') {

chronos_npm_package/controllers/mongo.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,8 @@ mongo.connect = async ({ database }) => {
2727
console.log('Attemping to connect to database...');
2828
try {
2929
await mongoose.connect(`${database.URI}`);
30-
// Print success message
3130
console.log(`MongoDB database connected at ${database.URI.slice(0, 20)}...`);
3231
} catch ({ message }) {
33-
// Print error message
3432
console.log('Error connecting to MongoDB:', message);
3533
}
3634
};
@@ -71,7 +69,7 @@ mongo.communications = ({ microservice, slack, email }) => {
7169
request: req.method,
7270
correlatingid: res.getHeaders()['x-correlation-id'],
7371
};
74-
console.log("NEW COMMS",newComms)
72+
// console.log("NEW COMMS",newComms)
7573

7674
res.on('finish', () => {
7775
/**

0 commit comments

Comments
 (0)