Skip to content

Commit

Permalink
update code of usage of gorpc waitgroup
Browse files Browse the repository at this point in the history
  • Loading branch information
sredny buitrago authored and sredny buitrago committed Oct 23, 2024
1 parent 56ec4bc commit 0ea1d8d
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ require (
github.com/TykTechnologies/drl v0.0.0-20221208085827-9bc9b4338f26
github.com/TykTechnologies/goautosocket v0.0.0-20190430121222-97bfa5e7e481
github.com/TykTechnologies/gojsonschema v0.0.0-20170222154038-dcb3e4bb7990
github.com/TykTechnologies/gorpc v0.0.0-20210624160652-fe65bda0ccb9
github.com/TykTechnologies/gorpc v0.0.0-20241016124253-606484472fbb
github.com/TykTechnologies/goverify v0.0.0-20220808203004-1486f89e7708
github.com/TykTechnologies/graphql-go-tools v1.6.2-0.20240201085637-06899f14ba13
github.com/TykTechnologies/leakybucket v0.0.0-20170301023702-71692c943e3c
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@ github.com/TykTechnologies/gojsonschema v0.0.0-20170222154038-dcb3e4bb7990 h1:CJ
github.com/TykTechnologies/gojsonschema v0.0.0-20170222154038-dcb3e4bb7990/go.mod h1:SQT0NBrY4/pMikBgwFIrWCjcHBxg015Y8is0kAnMtug=
github.com/TykTechnologies/gorpc v0.0.0-20210624160652-fe65bda0ccb9 h1:fbxHiuw/244CQ4TEirzgL/CIMXDUx2szZn8cuuMlCy0=
github.com/TykTechnologies/gorpc v0.0.0-20210624160652-fe65bda0ccb9/go.mod h1:v6v7Mlj08+EmEcXOfpuTxGt2qYU9yhqqtv4QF9Wf50E=
github.com/TykTechnologies/gorpc v0.0.0-20241016124253-606484472fbb h1:4ZQmRdKvOgE/KSlwT7Ze/imlWaC/z9kynUL4lADCz3Y=
github.com/TykTechnologies/gorpc v0.0.0-20241016124253-606484472fbb/go.mod h1:v6v7Mlj08+EmEcXOfpuTxGt2qYU9yhqqtv4QF9Wf50E=
github.com/TykTechnologies/goverify v0.0.0-20220808203004-1486f89e7708 h1:cmXjlMzcexhc/Cg+QB/c2CPUVs1ux9xn6162qaf/LC4=
github.com/TykTechnologies/goverify v0.0.0-20220808203004-1486f89e7708/go.mod h1:mkS8jKcz8otdfEXhJs1QQ/DKoIY1NFFsRPKS0RwQENI=
github.com/TykTechnologies/graphql-go-tools v1.6.2-0.20230320143102-7a16078ce517/go.mod h1:ZiFZcrue3+n2mHH+KLHRipbYVULkgy3Myko5S7IIs74=
Expand Down
6 changes: 1 addition & 5 deletions rpc/rpc_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -258,10 +258,6 @@ func Connect(connConfig Config, suppressRegister bool, dispatcherFuncs map[strin
clientSingleton.Conns = 5
}

for i := 0; i < clientSingleton.Conns; i++ {
connectionDialingWG.Add(1)
}

clientSingleton.Dial = func(addr string) (conn net.Conn, err error) {
defer connectionDialingWG.Done()
dialer := &net.Dialer{
Expand Down Expand Up @@ -312,7 +308,7 @@ func Connect(connConfig Config, suppressRegister bool, dispatcherFuncs map[strin
}

// wait until all the pool connections are dialed so we can call login
connectionDialingWG.Wait()
clientSingleton.WaitForConnection()
handleLogin()
if !suppressRegister {
register()
Expand Down

0 comments on commit 0ea1d8d

Please sign in to comment.