Skip to content

Commit

Permalink
fix: async get chanel
Browse files Browse the repository at this point in the history
  • Loading branch information
DIY0R committed Jul 18, 2024
1 parent 0c90baa commit 7b7fb2b
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/rmq.global.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ export class RmqGlobalService implements OnModuleInit {
private sendResponseEmitter: EventEmitter = new EventEmitter();
private logger: LoggerService;
private isInitialized = false;
public channel: Channel | ConfirmChannel = null;

constructor(
private readonly rmqNestjsConnectService: RmqNestjsConnectService,
Expand All @@ -48,9 +47,12 @@ export class RmqGlobalService implements OnModuleInit {
}
async onModuleInit() {
if (this.globalOptions?.globalBroker?.replyTo) await this.replyQueue();
this.channel = await this.rmqNestjsConnectService.getBaseChanel();
this.isInitialized = true;
}
get channel(): Promise<Channel | ConfirmChannel> {
return this.rmqNestjsConnectService.getBaseChanel();
}
async chanel() {}
public async send<IMessage, IReply>(
exchange: string,
topic: string,
Expand Down

0 comments on commit 7b7fb2b

Please sign in to comment.