refactor
This commit is contained in:
parent
fd7b77c542
commit
b6f21b6edb
16 changed files with 104 additions and 21 deletions
|
@ -55,11 +55,6 @@ export class AntennaService implements OnApplicationShutdown {
|
|||
this.redisForSub.on('message', this.onRedisMessage);
|
||||
}
|
||||
|
||||
@bindThis
|
||||
public onApplicationShutdown(signal?: string | undefined) {
|
||||
this.redisForSub.off('message', this.onRedisMessage);
|
||||
}
|
||||
|
||||
@bindThis
|
||||
private async onRedisMessage(_: string, data: string): Promise<void> {
|
||||
const obj = JSON.parse(data);
|
||||
|
@ -196,4 +191,14 @@ export class AntennaService implements OnApplicationShutdown {
|
|||
|
||||
return this.antennas;
|
||||
}
|
||||
|
||||
@bindThis
|
||||
public dispose(): void {
|
||||
this.redisForSub.off('message', this.onRedisMessage);
|
||||
}
|
||||
|
||||
@bindThis
|
||||
public onApplicationShutdown(signal?: string | undefined): void {
|
||||
this.dispose();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue