Adjusting how redis modules are loaded, making sure client is always set, before init.

This commit is contained in:
mike12345567 2021-07-23 16:53:22 +01:00
parent 3e8d7a8ae2
commit 68a2f9835e
2 changed files with 8 additions and 4 deletions

View File

@ -7,8 +7,10 @@ let devAppClient, debounceClient
// we init this as we want to keep the connection open all the time
// reduces the performance hit
exports.init = async () => {
devAppClient = await new Client(utils.Databases.DEV_LOCKS).init()
debounceClient = await new Client(utils.Databases.DEBOUNCE).init()
devAppClient = new Client(utils.Databases.DEV_LOCKS)
debounceClient = new Client(utils.Databases.DEBOUNCE)
await devAppClient.init()
await debounceClient.init()
}
exports.shutdown = async () => {

View File

@ -43,8 +43,10 @@ async function getACode(db, code, deleteCode = true) {
}
exports.init = async () => {
pwResetClient = await new Client(utils.Databases.PW_RESETS).init()
invitationClient = await new Client(utils.Databases.INVITATIONS).init()
pwResetClient = new Client(utils.Databases.PW_RESETS)
invitationClient = new Client(utils.Databases.INVITATIONS)
await pwResetClient.init()
await invitationClient.init()
}
/**