mirror of
https://github.com/farcasclaudiu/Flowise.git
synced 2026-06-28 23:01:09 +03:00
redis_keep_alive fix on usagecachemanager using keyv/redis (#5519)
This commit is contained in:
committed by
GitHub
parent
20db1597a4
commit
069ba28bc0
@@ -37,7 +37,19 @@ export class UsageCacheManager {
|
|||||||
if (process.env.MODE === MODE.QUEUE) {
|
if (process.env.MODE === MODE.QUEUE) {
|
||||||
let redisConfig: string | Record<string, any>
|
let redisConfig: string | Record<string, any>
|
||||||
if (process.env.REDIS_URL) {
|
if (process.env.REDIS_URL) {
|
||||||
redisConfig = process.env.REDIS_URL
|
redisConfig = {
|
||||||
|
url: process.env.REDIS_URL,
|
||||||
|
socket: {
|
||||||
|
keepAlive:
|
||||||
|
process.env.REDIS_KEEP_ALIVE && !isNaN(parseInt(process.env.REDIS_KEEP_ALIVE, 10))
|
||||||
|
? parseInt(process.env.REDIS_KEEP_ALIVE, 10)
|
||||||
|
: undefined
|
||||||
|
},
|
||||||
|
pingInterval:
|
||||||
|
process.env.REDIS_KEEP_ALIVE && !isNaN(parseInt(process.env.REDIS_KEEP_ALIVE, 10))
|
||||||
|
? parseInt(process.env.REDIS_KEEP_ALIVE, 10)
|
||||||
|
: undefined
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
redisConfig = {
|
redisConfig = {
|
||||||
username: process.env.REDIS_USERNAME || undefined,
|
username: process.env.REDIS_USERNAME || undefined,
|
||||||
@@ -48,8 +60,16 @@ export class UsageCacheManager {
|
|||||||
tls: process.env.REDIS_TLS === 'true',
|
tls: process.env.REDIS_TLS === 'true',
|
||||||
cert: process.env.REDIS_CERT ? Buffer.from(process.env.REDIS_CERT, 'base64') : undefined,
|
cert: process.env.REDIS_CERT ? Buffer.from(process.env.REDIS_CERT, 'base64') : undefined,
|
||||||
key: process.env.REDIS_KEY ? Buffer.from(process.env.REDIS_KEY, 'base64') : undefined,
|
key: process.env.REDIS_KEY ? Buffer.from(process.env.REDIS_KEY, 'base64') : undefined,
|
||||||
ca: process.env.REDIS_CA ? Buffer.from(process.env.REDIS_CA, 'base64') : undefined
|
ca: process.env.REDIS_CA ? Buffer.from(process.env.REDIS_CA, 'base64') : undefined,
|
||||||
}
|
keepAlive:
|
||||||
|
process.env.REDIS_KEEP_ALIVE && !isNaN(parseInt(process.env.REDIS_KEEP_ALIVE, 10))
|
||||||
|
? parseInt(process.env.REDIS_KEEP_ALIVE, 10)
|
||||||
|
: undefined
|
||||||
|
},
|
||||||
|
pingInterval:
|
||||||
|
process.env.REDIS_KEEP_ALIVE && !isNaN(parseInt(process.env.REDIS_KEEP_ALIVE, 10))
|
||||||
|
? parseInt(process.env.REDIS_KEEP_ALIVE, 10)
|
||||||
|
: undefined
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
this.cache = createCache({
|
this.cache = createCache({
|
||||||
|
|||||||
Reference in New Issue
Block a user