Skip to content

Commit

Permalink
fix(core): configure redis-client according to docs
Browse files Browse the repository at this point in the history
set password in constructor to prevent racing conditions

fixes #26
  • Loading branch information
error418 committed Jul 24, 2019
1 parent fbbf797 commit 605808c
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions src/core/db/redis-client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ class RedisClientFactory {
public createClient(databaseIndex = 0): RedisClient {
const client = new RedisClient({
host: this.database,
password: (this.password) ? this.password : undefined,
retry_strategy: (options) => {
return 5000;
}
Expand All @@ -82,11 +83,6 @@ class RedisClientFactory {
this.eventBus.emit(new DatabaseReconnectEvent(databaseIndex));
});

// set authentication if available
if (this.password) {
client.auth(this.password);
}

client.select(databaseIndex);

this.registeredClients.push(client);
Expand Down

0 comments on commit 605808c

Please sign in to comment.