Skip to content

Commit

Permalink
refactor(api): Updated Redis provider
Browse files Browse the repository at this point in the history
  • Loading branch information
rajdip-b committed Jul 12, 2024
1 parent 1756727 commit 33491a1
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 8 deletions.
1 change: 0 additions & 1 deletion .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -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=
Expand Down
8 changes: 2 additions & 6 deletions apps/api/src/provider/redis.provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
1 change: 0 additions & 1 deletion docs/contributing-to-keyshade/environment-variables.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 33491a1

Please sign in to comment.