@heathmont/lab-flask
Advanced tools
Comparing version 0.3.2 to 0.3.3
@@ -63,3 +63,3 @@ "use strict"; | ||
exports.init = function (options, initDefaultContext) { return __awaiter(_this, void 0, void 0, function () { | ||
var requiredOptions, flaskName, flaskUrl, expressServer, labUrl, flaskPrivKey, instanceUuid, instanceUrl, healthCheckFunction, defaultContext, autoStartHealthChecks, pki, privateKey, publicKey, flaskPubKey, flaskPathname, flaskPathnameProto, labConfig, callReaction, callElement, implementFlaskSubstance, implementSubstance, failedHealthchecks, startHealthCheck; | ||
var requiredOptions, flaskName, flaskUrl, expressServer, labUrl, flaskPrivKey, instanceUuid, instanceUrl, healthCheckFunction, defaultContext, autoStartHealthChecks, pki, privateKey, publicKey, flaskPubKey, flaskPathname, flaskPathnameProto, labConfig, callReaction, callElement, implementFlaskSubstance, implementSubstance, failedHealthChecks, startHealthCheck; | ||
var _this = this; | ||
@@ -131,3 +131,3 @@ return __generator(this, function (_a) { | ||
}; | ||
failedHealthchecks = 0; | ||
failedHealthChecks = 0; | ||
startHealthCheck = function () { return __awaiter(_this, void 0, void 0, function () { | ||
@@ -142,3 +142,3 @@ var error_1; | ||
_a.sent(); | ||
failedHealthchecks = 0; | ||
failedHealthChecks = 0; | ||
setTimeout(startHealthCheck, 10000); | ||
@@ -148,5 +148,5 @@ return [3 /*break*/, 3]; | ||
error_1 = _a.sent(); | ||
failedHealthchecks = failedHealthchecks + 1; | ||
node_logger_1.logger.error('Error sending health check to LAB', { error: error_1 }); | ||
if (failedHealthchecks > 3) { | ||
failedHealthChecks = failedHealthChecks + 1; | ||
node_logger_1.logger.error('Error sending health check to LAB', { error: error_1, failedHealthChecks: failedHealthChecks }); | ||
if (failedHealthChecks > 3 && !process.env.SURVIVE_WITHOUT_LAB) { | ||
node_logger_1.logger.error('Health checks failed with LAB, bailing out.'); | ||
@@ -153,0 +153,0 @@ process.exit(1); |
{ | ||
"name": "@heathmont/lab-flask", | ||
"version": "0.3.2", | ||
"version": "0.3.3", | ||
"author": "Margus Lamp", | ||
@@ -5,0 +5,0 @@ "main": "./dist/index.js", |
@@ -176,12 +176,12 @@ import 'source-map-support/register'; | ||
}; | ||
let failedHealthchecks = 0; | ||
let failedHealthChecks = 0; | ||
const startHealthCheck = async () => { | ||
try { | ||
await sendHealthCheck(labConfig, healthCheckFunction(), callReaction); | ||
failedHealthchecks = 0; | ||
failedHealthChecks = 0; | ||
setTimeout(startHealthCheck, 10000); | ||
} catch (error) { | ||
failedHealthchecks = failedHealthchecks + 1; | ||
logger.error('Error sending health check to LAB', { error }); | ||
if (failedHealthchecks > 3) { | ||
failedHealthChecks = failedHealthChecks + 1; | ||
logger.error('Error sending health check to LAB', { error, failedHealthChecks }); | ||
if (failedHealthChecks > 3 && !process.env.SURVIVE_WITHOUT_LAB) { | ||
logger.error('Health checks failed with LAB, bailing out.'); | ||
@@ -188,0 +188,0 @@ process.exit(1); |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
117720
8