fix: parse redis url to get hostname and port (#5502)

* fix: parse redis url to get hostname and port

* fix: redis url accepted for connection

* chore: add redis url to example env

* fix: let users add redis port and host incase redis url is not present

* chore: create url from host and port variables

* fix: return empty string incase of no config
This commit is contained in:
M. Palanikannan 2024-09-03 17:29:03 +05:30 committed by GitHub
parent 5840b40d96
commit 1cd7259852
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 26 additions and 6 deletions

View file

@ -11,6 +11,8 @@ import {
fetchPageDescriptionBinary,
updatePageDescription,
} from "@/core/lib/page.js";
// config
import { getRedisConfig } from "./core/config/redis-config.js";
// types
import { TDocumentTypes } from "@/core/types/common.js";
// plane live lib
@ -46,10 +48,8 @@ const server = Server.configure({
}
},
extensions: [
new Redis({
host: process.env.REDIS_HOST || "localhost",
port: Number(process.env.REDIS_PORT || 6379),
}),
// @ts-expect-error - redis from hocuspocus is not typed properly
new Redis(getRedisConfig()),
new Logger(),
new Database({
fetch: async ({