1
0
Fork 0
mirror of synced 2024-07-06 15:00:49 +12:00

Create docWriteThrough redis cache

This commit is contained in:
Adria Navarro 2024-02-29 11:22:27 +01:00
parent a093cfca99
commit 40cc383c01
2 changed files with 13 additions and 1 deletions

View file

@ -9,7 +9,8 @@ let userClient: Client,
lockClient: Client,
socketClient: Client,
inviteClient: Client,
passwordResetClient: Client
passwordResetClient: Client,
docWritethroughClient: Client
export async function init() {
userClient = await new Client(utils.Databases.USER_CACHE).init()
@ -24,6 +25,9 @@ export async function init() {
utils.Databases.SOCKET_IO,
utils.SelectableDatabase.SOCKET_IO
).init()
docWritethroughClient = await new Client(
utils.Databases.DOC_WRITE_THROUGH
).init()
}
export async function shutdown() {
@ -104,3 +108,10 @@ export async function getPasswordResetClient() {
}
return passwordResetClient
}
export async function getDocWritethroughClient() {
if (!writethroughClient) {
await init()
}
return writethroughClient
}

View file

@ -30,6 +30,7 @@ export enum Databases {
LOCKS = "locks",
SOCKET_IO = "socket_io",
BPM_EVENTS = "bpmEvents",
DOC_WRITE_THROUGH = "docWriteThrough",
}
/**