Create docWriteThrough redis cache
This commit is contained in:
parent
a093cfca99
commit
40cc383c01
|
@ -9,7 +9,8 @@ let userClient: Client,
|
||||||
lockClient: Client,
|
lockClient: Client,
|
||||||
socketClient: Client,
|
socketClient: Client,
|
||||||
inviteClient: Client,
|
inviteClient: Client,
|
||||||
passwordResetClient: Client
|
passwordResetClient: Client,
|
||||||
|
docWritethroughClient: Client
|
||||||
|
|
||||||
export async function init() {
|
export async function init() {
|
||||||
userClient = await new Client(utils.Databases.USER_CACHE).init()
|
userClient = await new Client(utils.Databases.USER_CACHE).init()
|
||||||
|
@ -24,6 +25,9 @@ export async function init() {
|
||||||
utils.Databases.SOCKET_IO,
|
utils.Databases.SOCKET_IO,
|
||||||
utils.SelectableDatabase.SOCKET_IO
|
utils.SelectableDatabase.SOCKET_IO
|
||||||
).init()
|
).init()
|
||||||
|
docWritethroughClient = await new Client(
|
||||||
|
utils.Databases.DOC_WRITE_THROUGH
|
||||||
|
).init()
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function shutdown() {
|
export async function shutdown() {
|
||||||
|
@ -104,3 +108,10 @@ export async function getPasswordResetClient() {
|
||||||
}
|
}
|
||||||
return passwordResetClient
|
return passwordResetClient
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export async function getDocWritethroughClient() {
|
||||||
|
if (!writethroughClient) {
|
||||||
|
await init()
|
||||||
|
}
|
||||||
|
return writethroughClient
|
||||||
|
}
|
||||||
|
|
|
@ -30,6 +30,7 @@ export enum Databases {
|
||||||
LOCKS = "locks",
|
LOCKS = "locks",
|
||||||
SOCKET_IO = "socket_io",
|
SOCKET_IO = "socket_io",
|
||||||
BPM_EVENTS = "bpmEvents",
|
BPM_EVENTS = "bpmEvents",
|
||||||
|
DOC_WRITE_THROUGH = "docWriteThrough",
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue