mirror of https://github.com/grpc/grpc-node.git
chore: extraneous closure, dont need server ref
This commit is contained in:
parent
0b79b7420a
commit
74102fcc87
|
@ -1191,11 +1191,10 @@ export class Server {
|
|||
channelzSessionInfo?.streamTracker.addCallFailed();
|
||||
}
|
||||
|
||||
private _channelzHandler(http2Server: http2.Http2Server) {
|
||||
return (
|
||||
private _channelzHandler(
|
||||
stream: http2.ServerHttp2Stream,
|
||||
headers: http2.IncomingHttpHeaders
|
||||
) => {
|
||||
) {
|
||||
// for handling idle timeout
|
||||
this.onStreamOpened(stream);
|
||||
|
||||
|
@ -1273,14 +1272,12 @@ export class Server {
|
|||
details: `Unknown handler type: ${handler.type}`,
|
||||
});
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
private _streamHandler(http2Server: http2.Http2Server) {
|
||||
return (
|
||||
private _streamHandler(
|
||||
stream: http2.ServerHttp2Stream,
|
||||
headers: http2.IncomingHttpHeaders
|
||||
) => {
|
||||
) {
|
||||
// for handling idle timeout
|
||||
this.onStreamOpened(stream);
|
||||
|
||||
|
@ -1315,7 +1312,6 @@ export class Server {
|
|||
details: `Unknown handler type: ${handler.type}`,
|
||||
});
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
private _runHandlerForCall(
|
||||
|
@ -1361,14 +1357,14 @@ export class Server {
|
|||
this.serverAddressString = serverAddressString;
|
||||
|
||||
const handler = this.channelzEnabled
|
||||
? this._channelzHandler(http2Server)
|
||||
: this._streamHandler(http2Server);
|
||||
? this._channelzHandler
|
||||
: this._streamHandler;
|
||||
|
||||
const sessionHandler = this.channelzEnabled
|
||||
? this._channelzSessionHandler(http2Server)
|
||||
: this._sessionHandler(http2Server);
|
||||
|
||||
http2Server.on('stream', handler);
|
||||
http2Server.on('stream', handler.bind(this));
|
||||
http2Server.on('session', sessionHandler);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue