Skip to content

Commit

Permalink
comments fix
Browse files Browse the repository at this point in the history
  • Loading branch information
paulyufan2 committed Apr 25, 2024
1 parent abaf171 commit d9294db
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
7 changes: 4 additions & 3 deletions cns/restserver/v2/server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ func TestStartServerWithCNSPort(t *testing.T) {

// Create the service with -p 8000
if err = startService(cnsPort, ""); err != nil {
t.Errorf("Failed to start CNS Service. Error: %v", err)
t.Errorf("Failed to connect to CNS Service on expected port:%s. Error: %v", cnsPort, err)
os.Exit(1)
}
}
Expand All @@ -38,8 +38,9 @@ func TestStartServerWithCNSURL(t *testing.T) {
logger.InitLogger("testlogs", 0, 0, "./")

// Create the service with -c "localhost:8000"
if err = startService("", "tcp://localhost:8500"); err != nil {
t.Errorf("Failed to start CNS Service. Error: %v", err)
url := "tcp://localhost:8500"
if err = startService("", url); err != nil {
t.Errorf("Failed to connect to CNS Service by this url:%s. Error: %v", url, err)
os.Exit(1)
}
}
Expand Down
13 changes: 6 additions & 7 deletions cns/service/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -877,13 +877,12 @@ func main() {
httpRemoteRestService.RegisterPProfEndpoints()
}

go func() {
err = httpRemoteRestService.Start(&config)
if err != nil {
logger.Errorf("Failed to start CNS, err:%v.\n", err)
return
}
}()
err = httpRemoteRestService.Start(&config)
if err != nil {
logger.Errorf("Failed to start CNS, err:%v.\n", err)
return
}

}

// if user does not provide cns url by -c option, then start http local server
Expand Down

0 comments on commit d9294db

Please sign in to comment.