From 33491a199c5ae7f822e44936eebab964f7f93ac5 Mon Sep 17 00:00:00 2001 From: rajdip-b Date: Fri, 12 Jul 2024 12:01:57 +0530 Subject: [PATCH] refactor(api): Updated Redis provider --- .env.example | 1 - apps/api/src/provider/redis.provider.ts | 8 ++------ docs/contributing-to-keyshade/environment-variables.md | 1 - 3 files changed, 2 insertions(+), 8 deletions(-) diff --git a/.env.example b/.env.example index 8ee4adc1..e403a499 100644 --- a/.env.example +++ b/.env.example @@ -2,7 +2,6 @@ DATABASE_URL=postgresql://postgres:password@127.0.0.1:5432/keyshade_db ADMIN_EMAIL=your@email.com REDIS_URL=redis://127.0.0.1:6379 -REDIS_PASSWORD= GITHUB_CLIENT_ID= GITHUB_CLIENT_SECRET= diff --git a/apps/api/src/provider/redis.provider.ts b/apps/api/src/provider/redis.provider.ts index cf51baa2..827de106 100644 --- a/apps/api/src/provider/redis.provider.ts +++ b/apps/api/src/provider/redis.provider.ts @@ -14,13 +14,9 @@ export const RedisProvider: Provider = { } const subscriber = redis.createClient({ - url: process.env.REDIS_URL, - password: process.env.REDIS_PASSWORD - }) - const publisher = redis.createClient({ - url: process.env.REDIS_URL, - password: process.env.REDIS_PASSWORD + url: process.env.REDIS_URL }) + const publisher = subscriber.duplicate() publisher.on('error', (error) => { logger.error('Redis client error:', error) diff --git a/docs/contributing-to-keyshade/environment-variables.md b/docs/contributing-to-keyshade/environment-variables.md index cf2dbf62..b8f10807 100644 --- a/docs/contributing-to-keyshade/environment-variables.md +++ b/docs/contributing-to-keyshade/environment-variables.md @@ -34,7 +34,6 @@ Here's the description of the environment variables used in the project. You can - **MINIO_USE_SSL**: Whether to use SSL for the Minio connection or not. - **MINIO_BUCKET_NAME**: The name of the bucket in the Minio server where the files are stored. - **REDIS_URL**: The required parameter URL that is used by the API to connect to the Redis instance. -- **REDIS_PASSWORD**: The optional parameter that is used by the API. This is specified only if the Redis instance is configured to use a password. - **FEEDBACK_FORWARD_EMAIL**: Feedbacks submitted by the user would be sent to this email address for the concerned authorities to view it. Ideally, in development environment, this would be your personal email address