Add eslint rule and fix as many issues as possible

This commit is contained in:
Khoa Le
2023-06-19 23:42:04 -04:00
parent e9eacc445d
commit 9d33e4756b
689 changed files with 9446 additions and 21821 deletions
+10 -10
View File
@@ -1,19 +1,19 @@
import mongoose from 'mongoose';
import { createTerminus } from '@godaddy/terminus';
import { getLogger } from '../utils/logger';
import mongoose from "mongoose";
import { createTerminus } from "@godaddy/terminus";
import { getLogger } from "../utils/logger";
export const setUpHealthEndpoint = <T>(server: T) => {
const onSignal = async () => {
(await getLogger('backend-main')).info('Server is starting clean-up');
(await getLogger("backend-main")).info("Server is starting clean-up");
return Promise.all([
new Promise((resolve) => {
if (mongoose.connection && mongoose.connection.readyState == 1) {
mongoose.connection.close()
.then(() => resolve('Database connection closed'));
.then(() => resolve("Database connection closed"));
} else {
resolve('Database connection already closed');
resolve("Database connection already closed");
}
})
}),
]);
};
@@ -25,8 +25,8 @@ export const setUpHealthEndpoint = <T>(server: T) => {
createTerminus(server, {
healthChecks: {
'/healthcheck': healthCheck,
onSignal
}
"/healthcheck": healthCheck,
onSignal,
},
});
};