Skip to content

Commit 2e3f20d

Browse files
committed
fix: rename redis_url to redisUrl to align with other config option naming convention + fix: readme
1 parent e291666 commit 2e3f20d

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ const nextConfig = {
6060
}
6161
```
6262

63-
Make sure to set either REDIS_URL or REDISHOST and REDISPORT environment variables.
63+
Make sure to set either redisUrl or REDISHOST and REDISPORT environment variables.
6464

6565
### Option B: create a wrapper file to change options
6666

src/RedisStringsHandler.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,12 @@ export type CacheEntry = {
1414
};
1515

1616
export type CreateRedisStringsHandlerOptions = {
17-
/** Redis redis_url to use.
18-
* @default process.env.REDIS_URL? process.env.REDIS_URL : process.env.REDISHOST
17+
/** Redis redisUrl to use.
18+
* @default process.env.redisUrl? process.env.redisUrl : process.env.REDISHOST
1919
? `redis://${process.env.REDISHOST}:${process.env.REDISPORT}`
2020
: 'redis://localhost:6379'
2121
*/
22-
redis_url?: string;
22+
redisUrl?: string;
2323
/** Redis database number to use. Uses DB 0 for production, DB 1 otherwise
2424
* @default process.env.VERCEL_ENV === 'production' ? 0 : 1
2525
*/
@@ -97,8 +97,8 @@ export default class RedisStringsHandler {
9797
private estimateExpireAge: (staleAge: number) => number;
9898

9999
constructor({
100-
redis_url = process.env.REDIS_URL
101-
? process.env.REDIS_URL
100+
redisUrl = process.env.redisUrl
101+
? process.env.redisUrl
102102
: process.env.REDISHOST
103103
? `redis://${process.env.REDISHOST}:${process.env.REDISPORT}`
104104
: 'redis://localhost:6379',
@@ -124,7 +124,7 @@ export default class RedisStringsHandler {
124124
try {
125125
this.client = createClient({
126126
...(database !== 0 ? { database } : {}),
127-
url: redis_url,
127+
url: redisUrl,
128128
});
129129

130130
this.client.on('error', (error) => {

0 commit comments

Comments
 (0)