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()
|
appClient = await new Client(utils.Databases.APP_METADATA).init()
|
||||||
cacheClient = await new Client(utils.Databases.GENERIC_CACHE).init()
|
cacheClient = await new Client(utils.Databases.GENERIC_CACHE).init()
|
||||||
lockClient = await new Client(utils.Databases.LOCKS).init()
|
lockClient = await new Client(utils.Databases.LOCKS).init()
|
||||||
writethroughClient = await new Client(
|
writethroughClient = await new Client(utils.Databases.WRITE_THROUGH).init()
|
||||||
utils.Databases.WRITE_THROUGH,
|
|
||||||
utils.SelectableDatabase.WRITE_THROUGH
|
|
||||||
).init()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function shutdown() {
|
export async function shutdown() {
|
||||||
|
|
|
@ -183,6 +183,9 @@ class RedisWrapper {
|
||||||
CLOSED = false
|
CLOSED = false
|
||||||
init(this._select)
|
init(this._select)
|
||||||
await waitForConnection(this._select)
|
await waitForConnection(this._select)
|
||||||
|
if (this._select) {
|
||||||
|
this.getClient().select(this._select)
|
||||||
|
}
|
||||||
return this
|
return this
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -41,7 +41,7 @@ export enum Databases {
|
||||||
*/
|
*/
|
||||||
export enum SelectableDatabase {
|
export enum SelectableDatabase {
|
||||||
DEFAULT = 0,
|
DEFAULT = 0,
|
||||||
WRITE_THROUGH = 1,
|
SOCKET_IO = 1,
|
||||||
UNUSED_1 = 2,
|
UNUSED_1 = 2,
|
||||||
UNUSED_2 = 3,
|
UNUSED_2 = 3,
|
||||||
UNUSED_3 = 4,
|
UNUSED_3 = 4,
|
||||||
|
|
|
@ -15,7 +15,7 @@ export async function init() {
|
||||||
devAppClient = new redis.Client(redis.utils.Databases.DEV_LOCKS)
|
devAppClient = new redis.Client(redis.utils.Databases.DEV_LOCKS)
|
||||||
debounceClient = new redis.Client(redis.utils.Databases.DEBOUNCE)
|
debounceClient = new redis.Client(redis.utils.Databases.DEBOUNCE)
|
||||||
flagClient = new redis.Client(redis.utils.Databases.FLAGS)
|
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 devAppClient.init()
|
||||||
await debounceClient.init()
|
await debounceClient.init()
|
||||||
await flagClient.init()
|
await flagClient.init()
|
||||||
|
|
Loading…
Reference in New Issue