Skip to content

remove logic that stops gw loading until emergency mode is triggered or rpc conn is successful #6890

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 1 addition & 19 deletions rpc/rpc_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -303,8 +303,7 @@ func Connect(connConfig Config, suppressRegister bool, dispatcherFuncs map[strin
if funcClientSingleton == nil {
funcClientSingleton = dispatcher.NewFuncClient(clientSingleton)
}
// wait until a connection is dialed so we can call login or fall in emergency mode
waitForClientReadiness(clientSingleton)

handleLogin()

if !suppressRegister {
Expand All @@ -315,23 +314,6 @@ func Connect(connConfig Config, suppressRegister bool, dispatcherFuncs map[strin
return true
}

func waitForClientReadiness(clientSingleton *gorpc.Client) {
ticker := time.NewTicker(100 * time.Millisecond)
defer ticker.Stop()

for {
if IsEmergencyMode() {
return
}

select {
case <-clientSingleton.ClientReadyChan:
return
case <-ticker.C:
}
}
}

func handleLogin() {
if UseSyncLoginRPC == true {
Login()
Expand Down
Loading