Added option to enable/disable redis session store; fixed the checks for username, password, and database number when setting up the Redis connection
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful

This commit is contained in:
2022-11-23 22:17:36 -05:00
parent 30bf9beea5
commit 6024a1fe7f
3 changed files with 25 additions and 15 deletions

View File

@ -4,11 +4,11 @@ exports.default = function() {
let redisUrl = 'redis://';
// add the redis username if defined
if (typeof redisConfig.get('username') !== 'undefined') {
if (redisConfig.has('username')) {
redisUrl += redisConfig.get('username');
}
// add the user password if defined
if (typeof redisConfig.get('password') !== 'undefined') {
if (redisConfig.has('password')) {
redisUrl += ':' + redisConfig.get('password') + '@';
}
// add redis host URL
@ -16,7 +16,7 @@ exports.default = function() {
// add redis host port
redisUrl += ':' + redisConfig.get('port');
// add redis database number if defined
if (typeof redisConfig.get('number') !== 'undefined') {
if (redisConfig.has('number')) {
redisUrl += redisConfig.get('number');
}