We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9ba60cd commit 40718f4Copy full SHA for 40718f4
packages/db/src/client.ts
@@ -16,11 +16,16 @@ if (!databaseUrl) {
16
17
const cache = process.env.REDIS_URL
18
? new RedisDrizzleCache({
19
- redis: new Redis(process.env.REDIS_URL ?? ""),
20
- defaultTtl: 300, // 5 minutes default
21
- strategy: "all", // Cache all queries by default
22
- namespace: "drizzle:db",
23
- })
+ redis: new Redis(process.env.REDIS_URL, {
+ connectTimeout: 10_000,
+ commandTimeout: 5000,
+ retryStrategy: (times) => Math.min(times * 100, 3000),
+ maxRetriesPerRequest: 3,
24
+ }),
25
+ defaultTtl: 300, // 5 minutes default
26
+ strategy: "all", // Cache all queries by default
27
+ namespace: "drizzle:db",
28
+ })
29
: undefined;
30
31
// @ts-expect-error - cache is not a Cache instance
0 commit comments