Skip to content

Commit fab13fd

Browse files
committed
Additional fixes for Haufe-Lexware/wicked.haufe.io#147
1 parent 70f41d1 commit fab13fd

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

src/kong/monitor.ts

+1
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ function pingKong(callback) {
8989
return;
9090
}
9191
info('Monitor: Kong is answering.');
92+
utils.setKongClusterStatus(results[1]);
9293
// utils.markKongAvailable(true, null, results[1]);
9394
if (callback)
9495
return callback(null);

src/kong/utils.ts

+6-2
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,10 @@ export function markKongAvailable(kongAvailable, kongMessage, clusterStatus) {
125125
_kongClusterStatus = clusterStatus;
126126
}
127127

128+
export function setKongClusterStatus(clusterStatus) {
129+
_kongClusterStatus = clusterStatus;
130+
};
131+
128132
export function getKongClusterStatus() {
129133
return _kongClusterStatus;
130134
}
@@ -339,7 +343,7 @@ let _packageFile = null;
339343
export function getPackageJson() {
340344
if (!_packageFile) {
341345
// Deliberately do not do any error handling here! package.json MUST exist.
342-
const packageFile = path.join(__dirname, '..', 'package.json');
346+
const packageFile = path.join(__dirname, '..', '..', 'package.json');
343347
_packageFile = JSON.parse(fs.readFileSync(packageFile, 'utf8'));
344348
}
345349
return _packageFile;
@@ -396,7 +400,7 @@ export function getGitBranch() {
396400
let _buildDate = null;
397401
export function getBuildDate() {
398402
if (!_buildDate) {
399-
const buildDateFile = path.join(__dirname, '..', 'build_date');
403+
const buildDateFile = path.join(__dirname, '..', '..', 'build_date');
400404
if (fs.existsSync(buildDateFile))
401405
_buildDate = fs.readFileSync(buildDateFile, 'utf8');
402406
else

0 commit comments

Comments
 (0)