Skip to content

Commit 605808c

Browse files
committed
fix(core): configure redis-client according to docs
set password in constructor to prevent racing conditions fixes #26
1 parent fbbf797 commit 605808c

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

src/core/db/redis-client.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ class RedisClientFactory {
6464
public createClient(databaseIndex = 0): RedisClient {
6565
const client = new RedisClient({
6666
host: this.database,
67+
password: (this.password) ? this.password : undefined,
6768
retry_strategy: (options) => {
6869
return 5000;
6970
}
@@ -82,11 +83,6 @@ class RedisClientFactory {
8283
this.eventBus.emit(new DatabaseReconnectEvent(databaseIndex));
8384
});
8485

85-
// set authentication if available
86-
if (this.password) {
87-
client.auth(this.password);
88-
}
89-
9086
client.select(databaseIndex);
9187

9288
this.registeredClients.push(client);

0 commit comments

Comments
 (0)