mirror of
https://github.com/openimsdk/open-im-server.git
synced 2025-12-08 21:47:17 +08:00
fix bug:delete getPromPort funciton
This commit is contained in:
parent
4bf5b00183
commit
d4524a6731
@ -96,7 +96,7 @@ func Start(
|
|||||||
go func() {
|
go func() {
|
||||||
if config.Config.Prometheus.Enable && prometheusPort != 0 {
|
if config.Config.Prometheus.Enable && prometheusPort != 0 {
|
||||||
// Create a HTTP server for prometheus.
|
// Create a HTTP server for prometheus.
|
||||||
httpServer := &http.Server{Handler: promhttp.HandlerFor(reg, promhttp.HandlerOpts{}), Addr: fmt.Sprintf("0.0.0.0:%d", getPromPort(rpcRegisterName))}
|
httpServer := &http.Server{Handler: promhttp.HandlerFor(reg, promhttp.HandlerOpts{}), Addr: fmt.Sprintf("0.0.0.0:%d", prometheusPort)}
|
||||||
if err := httpServer.ListenAndServe(); err != nil {
|
if err := httpServer.ListenAndServe(); err != nil {
|
||||||
log.Fatal("Unable to start a http server.")
|
log.Fatal("Unable to start a http server.")
|
||||||
}
|
}
|
||||||
@ -127,6 +127,6 @@ func getPromPort(name string) int {
|
|||||||
return config.Config.Prometheus.ThirdPrometheusPort[0]
|
return config.Config.Prometheus.ThirdPrometheusPort[0]
|
||||||
default:
|
default:
|
||||||
fmt.Println("name not have correct prometheus port!!!")
|
fmt.Println("name not have correct prometheus port!!!")
|
||||||
return 9090
|
return 90
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user