Skip to content

Commit

Permalink
Merge pull request #356 from TarsCloud/fix/lbbniu/queuecap
Browse files Browse the repository at this point in the history
fix queuecap configuration not working
  • Loading branch information
lbbniu authored Apr 8, 2022
2 parents e872061 + 2e14817 commit ad6d2d3
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions tars/application.go
Original file line number Diff line number Diff line change
Expand Up @@ -217,22 +217,23 @@ func initConfig() {
end := endpoint.Parse(endString)
svrObj := c.GetString("/tars/application/server/" + adapter + "<servant>")
proto := c.GetString("/tars/application/server/" + adapter + "<protocol>")
queuecap := c.GetIntWithDef("/tars/application/server/"+adapter+"<queuecap>", svrCfg.QueueCap)
threads := c.GetInt("/tars/application/server/" + adapter + "<threads>")
svrCfg.Adapters[adapter] = adapterConfig{end, proto, svrObj, threads}
host := end.Host
if end.Bind != "" {
host = end.Bind
}
svrConf := &transport.TarsServerConf{
Proto: end.Proto,
Address: fmt.Sprintf("%s:%d", host, end.Port),
MaxInvoke: svrCfg.MaxInvoke,
AcceptTimeout: svrCfg.AcceptTimeout,
ReadTimeout: svrCfg.ReadTimeout,
WriteTimeout: svrCfg.WriteTimeout,
HandleTimeout: svrCfg.HandleTimeout,
IdleTimeout: svrCfg.IdleTimeout,

Proto: end.Proto,
Address: fmt.Sprintf("%s:%d", host, end.Port),
MaxInvoke: svrCfg.MaxInvoke,
AcceptTimeout: svrCfg.AcceptTimeout,
ReadTimeout: svrCfg.ReadTimeout,
WriteTimeout: svrCfg.WriteTimeout,
HandleTimeout: svrCfg.HandleTimeout,
IdleTimeout: svrCfg.IdleTimeout,
QueueCap: queuecap,
TCPNoDelay: svrCfg.TCPNoDelay,
TCPReadBuffer: svrCfg.TCPReadBuffer,
TCPWriteBuffer: svrCfg.TCPWriteBuffer,
Expand Down

0 comments on commit ad6d2d3

Please sign in to comment.