Merge branch 'develop' into fix/be/heap-size-and-dependency-bump
This commit is contained in:
15 files changed
+1247
-145
No files matched your search
@@ -19,18 +19,25 @@ const createHardwareCheck = async (hardwareCheckData) => {
|
||||
return null;
|
||||
}
|
||||
|
||||
let newUptimePercentage;
|
||||
if (monitor.uptimePercentage === undefined) {
|
||||
monitor.uptimePercentage = status === true ? 1 : 0;
|
||||
newUptimePercentage = status === true ? 1 : 0;
|
||||
} else {
|
||||
monitor.uptimePercentage =
|
||||
newUptimePercentage =
|
||||
(monitor.uptimePercentage * (n - 1) + (status === true ? 1 : 0)) / n;
|
||||
}
|
||||
await monitor.save();
|
||||
|
||||
await Monitor.findOneAndUpdate(
|
||||
{ _id: monitorId },
|
||||
{ uptimePercentage: newUptimePercentage }
|
||||
);
|
||||
|
||||
const hardwareCheck = await new HardwareCheck({
|
||||
...hardwareCheckData,
|
||||
}).save();
|
||||
return hardwareCheck;
|
||||
} catch (error) {
|
||||
console.log("error creating hardware check", error);
|
||||
error.service = SERVICE_NAME;
|
||||
error.method = "createHardwareCheck";
|
||||
throw error;
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
import globals from "globals";
|
||||
import pluginJs from "@eslint/js";
|
||||
import mochaPlugin from "eslint-plugin-mocha";
|
||||
|
||||
/*
|
||||
Please do not forget to look at the latest eslint configurations and rules.
|
||||
ESlint v9 configuration is different than v8.
|
||||
"https://eslint.org/docs/latest/use/configure/"
|
||||
*/
|
||||
|
||||
/** @type {import('eslint').Linter.Config[]} */
|
||||
export default [
|
||||
{
|
||||
languageOptions: {
|
||||
globals: {
|
||||
...globals.node, // Add Node.js globals
|
||||
},
|
||||
ecmaVersion: 2023,
|
||||
sourceType: "module",
|
||||
},
|
||||
},
|
||||
pluginJs.configs.recommended, // Core JS rules
|
||||
mochaPlugin.configs.flat.recommended, // Mocha rules
|
||||
{
|
||||
rules: {
|
||||
"mocha/max-top-level-suites": "warn", // Warn if there are too many top-level suites instead of failing
|
||||
},
|
||||
},
|
||||
];
|
||||
Generated
+863
-9
File diff suppressed because it is too large.
Load diff
+10
-2
@@ -6,7 +6,11 @@
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"test": "c8 mocha",
|
||||
"dev": "nodemon index.js"
|
||||
"dev": "nodemon index.js",
|
||||
"lint": "eslint .",
|
||||
"lint-fix": "eslint --fix .",
|
||||
"format": "prettier --write .",
|
||||
"format-check": "prettier --check ."
|
||||
},
|
||||
"keywords": [],
|
||||
"author": "",
|
||||
@@ -14,7 +18,7 @@
|
||||
"dependencies": {
|
||||
"axios": "^1.7.2",
|
||||
"bcrypt": "5.1.1",
|
||||
"bullmq": "5.34.3",
|
||||
"bullmq": "5.34.4",
|
||||
"cors": "^2.8.5",
|
||||
"dockerode": "4.0.2",
|
||||
"dotenv": "^16.4.5",
|
||||
@@ -35,9 +39,13 @@
|
||||
"winston": "^3.13.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@eslint/js": "^9.17.0",
|
||||
"c8": "10.1.3",
|
||||
"chai": "5.1.2",
|
||||
"eslint": "^9.17.0",
|
||||
"eslint-plugin-mocha": "^10.5.0",
|
||||
"esm": "3.2.25",
|
||||
"globals": "^15.14.0",
|
||||
"mocha": "11.0.1",
|
||||
"nodemon": "3.1.9",
|
||||
"prettier": "^3.3.3",
|
||||
|
||||
@@ -100,7 +100,6 @@ const successMessages = {
|
||||
|
||||
// Queue Controller
|
||||
QUEUE_GET_METRICS: "Got metrics successfully",
|
||||
QUEUE_GET_METRICS: "Got job stats successfully",
|
||||
QUEUE_ADD_JOB: "Job added successfully",
|
||||
QUEUE_OBLITERATE: "Queue obliterated",
|
||||
|
||||
|
||||
Reference in new issue
Block a user