Add back in functionality to select different redis DB's per client
This commit is contained in:
parent
d3fdb52bf5
commit
d926650232
|
@ -14,10 +14,7 @@ async function init() {
|
|||
appClient = await new Client(utils.Databases.APP_METADATA).init()
|
||||
cacheClient = await new Client(utils.Databases.GENERIC_CACHE).init()
|
||||
lockClient = await new Client(utils.Databases.LOCKS).init()
|
||||
writethroughClient = await new Client(
|
||||
utils.Databases.WRITE_THROUGH,
|
||||
utils.SelectableDatabase.WRITE_THROUGH
|
||||
).init()
|
||||
writethroughClient = await new Client(utils.Databases.WRITE_THROUGH).init()
|
||||
}
|
||||
|
||||
export async function shutdown() {
|
||||
|
|
|
@ -183,6 +183,9 @@ class RedisWrapper {
|
|||
CLOSED = false
|
||||
init(this._select)
|
||||
await waitForConnection(this._select)
|
||||
if (this._select) {
|
||||
this.getClient().select(this._select)
|
||||
}
|
||||
return this
|
||||
}
|
||||
|
||||
|
|
|
@ -41,7 +41,7 @@ export enum Databases {
|
|||
*/
|
||||
export enum SelectableDatabase {
|
||||
DEFAULT = 0,
|
||||
WRITE_THROUGH = 1,
|
||||
SOCKET_IO = 1,
|
||||
UNUSED_1 = 2,
|
||||
UNUSED_2 = 3,
|
||||
UNUSED_3 = 4,
|
||||
|
|
|
@ -15,7 +15,7 @@ export async function init() {
|
|||
devAppClient = new redis.Client(redis.utils.Databases.DEV_LOCKS)
|
||||
debounceClient = new redis.Client(redis.utils.Databases.DEBOUNCE)
|
||||
flagClient = new redis.Client(redis.utils.Databases.FLAGS)
|
||||
socketClient = new redis.Client(redis.utils.Databases.SOCKET_IO)
|
||||
socketClient = new redis.Client(redis.utils.Databases.SOCKET_IO, redis.utils.SelectableDatabase.SOCKET_IO)
|
||||
await devAppClient.init()
|
||||
await debounceClient.init()
|
||||
await flagClient.init()
|
||||
|
|
Loading…
Reference in New Issue