From 15adc792b46d6d39f242d71dbc5986401c8cf3ac Mon Sep 17 00:00:00 2001 From: edvardchen Date: Wed, 18 Sep 2019 18:22:51 +0800 Subject: [PATCH] fix(ges): onFinished once --- packages/grpc-experimental-server/src/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/grpc-experimental-server/src/index.ts b/packages/grpc-experimental-server/src/index.ts index cad47b3..95fc570 100644 --- a/packages/grpc-experimental-server/src/index.ts +++ b/packages/grpc-experimental-server/src/index.ts @@ -28,7 +28,7 @@ export class Context { constructor(public call: ServerCall, public definition: MethodDefinition) {} onFinished(listener: (err: Error | null) => void): void { const emitter = this.call as EventEmitter; - emitter.on('finish', listener).on('error', listener); + emitter.once('finish', listener).once('error', listener); } }