My understanding after reading the code of this library is that the Redis clients that are created by the default configuration are never closed.
To mitigate the memory leak, one can use the library like this to take control over the client lifecycle:
const redisUrl = '...'
const publisherRedisClient = createClient({ url: redisUrl })
await publisherRedisClient.connect()
const subscriberRedisClient = createClient({ url: redisUrl })
await subscriberRedisClient.connect()
const resumableStreamContextOpts = {
waitUntil: null,
publisher: publisherRedisClient,
subscriber: subscriberRedisClient,
}
My understanding after reading the code of this library is that the Redis clients that are created by the default configuration are never closed.
To mitigate the memory leak, one can use the library like this to take control over the client lifecycle: