feat: Optimize openim scripts and standard output logs (#1866)

* feat: add component check func

* fix: fix the outpu error

* fix: fix the stderr outpu

* fix: fix the component check func

* fix: fix the error

* fix: fix the output error

* fix: del the disruptions code

* fix the log output format

* fix: fix the tools version

* fix: fix the cycle detection

* fix: fix the error

* fix: fix the flag

* fix: add mongo ping detection

* fix: fix the tools pkg version

* fix: del the err

* feat: support openim readme docs

Signed-off-by: Xinwei Xiong (cubxxw) <3293172751nss@gmail.com>

* feat: support openim readme docs

Signed-off-by: Xinwei Xiong (cubxxw) <3293172751nss@gmail.com>

* feat: support openim readme docs

Signed-off-by: Xinwei Xiong (cubxxw) <3293172751nss@gmail.com>

* fix: fix the minio nil error

* fix: del the repeated wrap and add err print

* fix: fix this bug scripts

* Revert "Check"

---------

Signed-off-by: Xinwei Xiong (cubxxw) <3293172751nss@gmail.com>
Co-authored-by: luhaoling <2198702716@qq.com>
This commit is contained in:
Xinwei Xiong
2024-02-02 21:59:12 +08:00
committed by GitHub
parent af878a96cf
commit 854f8dbd2f
30 changed files with 146 additions and 67 deletions
+4 -3
View File
@@ -17,7 +17,6 @@ package startrpc
import (
"errors"
"fmt"
"github.com/OpenIMSDK/tools/errs"
"log"
"net"
"net/http"
@@ -28,6 +27,8 @@ import (
"syscall"
"time"
"github.com/OpenIMSDK/tools/errs"
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/client_golang/prometheus/promhttp"
"golang.org/x/sync/errgroup"
@@ -96,7 +97,7 @@ func Start(
err = rpcFn(client, srv)
if err != nil {
return errs.Wrap(err)
return err
}
err = client.Register(
rpcRegisterName,
@@ -116,7 +117,7 @@ func Start(
// Create a HTTP server for prometheus.
httpServer := &http.Server{Handler: promhttp.HandlerFor(reg, promhttp.HandlerOpts{}), Addr: fmt.Sprintf("0.0.0.0:%d", prometheusPort)}
if err := httpServer.ListenAndServe(); err != nil {
log.Fatal("Unable to start a http server.")
log.Fatal("Unable to start a http server. ", err.Error(), "PrometheusPort:", prometheusPort)
}
}
return nil