Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(INT-631): update redis expiry time #2609

Merged
merged 4 commits into from
Sep 15, 2023
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions sample.env
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ REDIS_PORT = 6379
REDIS_PASSWORD = 123
REDIS_USERNAME = abc
USE_REDIS_DB = true
REDIS_EXPIRY_TIME = 60*60
utsabc marked this conversation as resolved.
Show resolved Hide resolved
4 changes: 2 additions & 2 deletions src/util/redis/redisConnector.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ const RedisDB = {
log.error(`Redis is down at ${this.host}:${this.port}`);
return false; // stop retrying
},
tls: {}
tls: {},
});
this.client.on('ready', () => {
log.info(`Connected to redis at ${this.host}:${this.port}`);
Expand Down Expand Up @@ -102,7 +102,7 @@ const RedisDB = {
* @param {*} isValJson set to false if value is not a json object
*
*/
async setVal(key, value, expiryTimeInSec = 60 * 60) {
async setVal(key, value, expiryTimeInSec = process.env.REDIS_EXPIRY_TIME || 60 * 60) {
try {
await this.checkAndConnectConnection(); // check if redis is connected and if not, connect
if (typeof value === 'object') {
Expand Down
Loading