Refactor event bus and queue system; detect cycles in DI realization and make
Some checks failed
continuous-integration/drone/push Build is failing
Some checks failed
continuous-integration/drone/push Build is failing
This commit is contained in:
@@ -48,14 +48,20 @@ export class Redis extends Unit {
|
||||
*/
|
||||
public async getConnection(): Promise<IORedis.Redis> {
|
||||
if ( !this.connection ) {
|
||||
const options = this.config.get('redis.connection') as RedisOptions
|
||||
this.logging.verbose(options)
|
||||
this.connection = new IORedis(options)
|
||||
this.connection = await this.getNewConnection()
|
||||
}
|
||||
|
||||
return this.connection
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a new IORedis connection instance.
|
||||
*/
|
||||
public async getNewConnection(): Promise<IORedis.Redis> {
|
||||
const options = this.config.get('redis.connection') as RedisOptions
|
||||
return new IORedis(options)
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the IORedis connection in an AsyncPipe.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user