Skip to content

Commit

Permalink
Added tls to redis
Browse files Browse the repository at this point in the history
  • Loading branch information
ainsleyclark committed May 9, 2022
1 parent 8644e48 commit 8f29c86
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions service/snappy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -192,10 +192,12 @@ class Snapper {
private async loadRedis() {
const client = createClient({
username: Environment.redisUsername,
password: Environment.redisPassword,
database: Environment.redisDB,
socket: {
port: Environment.redisPort,
host: Environment.redisHost,
tls: Environment.redisTLS,
},
});

Expand Down
2 changes: 2 additions & 0 deletions util/env.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ export class Config {
redisUsername: string;
redisPassword: string;
redisDB: number;
redisTLS: boolean;

/**
* Creates a new config instance.
Expand Down Expand Up @@ -86,6 +87,7 @@ export class Config {
this.redisUsername = envVars.REDIS_USERNAME;
this.redisPassword = envVars.REDIS_PASSWORD;
this.redisDB = envVars.REDIS_DB !== '' ? envVars.REDIS_DB : 0;
this.redisTLS = envVars.REDIS_TLS === 'true';
}
}

Expand Down

0 comments on commit 8f29c86

Please sign in to comment.