mirror of
https://github.com/ragestudio/comty.git
synced 2025-06-09 10:34:17 +00:00
improve redis auth
This commit is contained in:
parent
5e29f2fa7e
commit
0d3650e03f
@ -21,11 +21,19 @@ function composeURL() {
|
||||
export default ({
|
||||
withWsAdapter = false
|
||||
} = {}) => {
|
||||
let client = createClient({
|
||||
let clientOpts = {
|
||||
url: composeURL(),
|
||||
password: process.env.REDIS_PASSWORD,
|
||||
username: process.env.REDIS_USERNAME,
|
||||
})
|
||||
}
|
||||
|
||||
if (process.env.REDIS_PASSWORD) {
|
||||
clientOpts.password = process.env.REDIS_PASSWORD
|
||||
}
|
||||
|
||||
if (process.env.REDIS_USERNAME) {
|
||||
clientOpts.username = process.env.REDIS_USERNAME
|
||||
}
|
||||
|
||||
let client = createClient()
|
||||
|
||||
if (withWsAdapter) {
|
||||
client.subClient = client.duplicate()
|
||||
|
Loading…
x
Reference in New Issue
Block a user