Skip to content
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

Add retry to getRemoteInfo #51

Merged
merged 1 commit into from
Mar 30, 2023
Merged
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
11 changes: 9 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -303,9 +303,16 @@ func main() {
if err != nil {
return nil, err
}
remoteInfoCache, err = c.GetInfo(opts.RemoteAdminAddr)
for retry := 0; retry < 3; retry++ {
remoteInfoCache, err = c.GetInfo(opts.RemoteAdminAddr)
if err != nil {
log.Printf("Get remote server info error: %v", err)
continue
}
break
}
if err != nil {
return nil, fmt.Errorf("Get remote server info error: %v. Please make sure server is online and accepting connections from this client address", err)
return nil, fmt.Errorf("failed to get remote server info, please make sure server is online and accepting connections from this client address")
}
return remoteInfoCache, nil
}
Expand Down