Skip to content

Commit

Permalink
lint fix
Browse files Browse the repository at this point in the history
  • Loading branch information
luominggang committed Jan 2, 2019
1 parent 54e28ab commit 710abf3
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion agent.go
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,7 @@ func (a *Agent) availableAllServices() {

func (a *Agent) unavailableAllServices() {
a.serviceRegistries.Range(func(k, v interface{}) bool {
v.(motan.Registry).Available(nil)
v.(motan.Registry).Unavailable(nil)
return true
})
}
Expand Down
3 changes: 1 addition & 2 deletions main/agentdemo.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,8 @@ func runAgentDemo() {
if err != nil {
http.Error(writer, fmt.Sprint(err), http.StatusInternalServerError)
return
} else {
fmt.Println(string(rawRequestBytes))
}
fmt.Println(string(rawRequestBytes))
})
http.ListenAndServe(addr, handler)
}()
Expand Down
3 changes: 1 addition & 2 deletions main/confsDemo/serverDemo.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,8 @@ func main() {
if err != nil {
http.Error(writer, fmt.Sprint(err), http.StatusInternalServerError)
return
} else {
fmt.Println(string(rawRequestBytes))
}
fmt.Println(string(rawRequestBytes))
})
http.ListenAndServe(addr, handler)
}()
Expand Down
3 changes: 2 additions & 1 deletion server/httpProxyServer.go
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,7 @@ func (s *HTTPProxyServer) doHTTPRpcProxy(ctx *fasthttp.RequestCtx, httpCluster *
vlog.Errorf("Http rpc proxy call failed: %s", motanResponse.GetException().ErrMsg)
ctx.Response.Header.SetServer(HTTPProxyServerName)
ctx.Response.Header.SetStatusCode(fasthttp.StatusBadGateway)
ctx.Response.SetBodyString("err_msg: " + motanResponse.GetException().ErrMsg)
return
}
// we need process deserialize here, maybe the httpCluster should initialize without proxy as a normal client
Expand All @@ -210,7 +211,7 @@ func (s *HTTPProxyServer) doHTTPRpcProxy(ctx *fasthttp.RequestCtx, httpCluster *
vlog.Errorf("Deserialize rpc response failed: %s", err.Error())
ctx.Response.Header.SetServer(HTTPProxyServerName)
ctx.Response.Header.SetStatusCode(fasthttp.StatusBadGateway)
ctx.Response.SetBodyString("err_msg: " + motanResponse.GetException().ErrMsg)
ctx.Response.SetBodyString("err_msg: " + err.Error())
return
}
if reply[0] != nil {
Expand Down

0 comments on commit 710abf3

Please sign in to comment.