Skip to content

Commit

Permalink
Fix for detecting whether or not in HA mode. Effected detecting ZSS c…
Browse files Browse the repository at this point in the history
…ookie and use of caching service

Signed-off-by: 1000TurquoisePogs <[email protected]>
  • Loading branch information
1000TurquoisePogs committed Dec 11, 2023
1 parent 0cc59f6 commit 9a52425
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

All notable changes to the Zlux Server Framework package will be documented in this file..
This repo is part of the app-server Zowe Component, and the change logs here may appear on Zowe.org in that section.

## 2.14.0
- Bugfix: App-server would not correctly detect when it was running in a high-availability configuration environment.

## 2.13.0
- Added support for using zowe.network and components.app-server.zowe.network to set listener IP and TLS properties including max and min version, ciphers, and ECDH curves. (#511)
Expand Down
6 changes: 4 additions & 2 deletions lib/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -490,9 +490,11 @@ module.exports.getCookieName = (cookieIdentifier) => {
return 'connect.sid.' + cookieIdentifier;
}


const HA_INSTANCE_COUNT=Object.keys(process.env).filter(key=>!key.match(/ZWE_haInstances_.*_components_.*hostname.*/)).filter(key=>key.match(/ZWE_haInstances_.*hostname/)).length;
const isHaMode = module.exports.isHaMode = function () {
const haInstanceCount = +process.env['ZWE_HA_INSTANCES_COUNT'];
return (!isNaN(haInstanceCount) && haInstanceCount > 1);
let isHaMode = (!isNaN(HA_INSTANCE_COUNT) && HA_INSTANCE_COUNT > 1);
return isHaMode;
}

//TODO, ATTLS
Expand Down

0 comments on commit 9a52425

Please sign in to comment.