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); } }