mirror of
https://github.com/openimsdk/open-im-server.git
synced 2025-11-05 03:42:08 +08:00
refactor
This commit is contained in:
parent
bbadbe3efb
commit
e53dcbe1a4
@ -26,6 +26,8 @@ import (
|
|||||||
"github.com/openimsdk/tools/mq/kafka"
|
"github.com/openimsdk/tools/mq/kafka"
|
||||||
"github.com/openimsdk/tools/s3/minio"
|
"github.com/openimsdk/tools/s3/minio"
|
||||||
"github.com/openimsdk/tools/system/program"
|
"github.com/openimsdk/tools/system/program"
|
||||||
|
"io/ioutil"
|
||||||
|
"log"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"time"
|
"time"
|
||||||
)
|
)
|
||||||
@ -33,6 +35,10 @@ import (
|
|||||||
const maxRetry = 180
|
const maxRetry = 180
|
||||||
|
|
||||||
func CheckZookeeper(ctx context.Context, config *config.ZooKeeper) error {
|
func CheckZookeeper(ctx context.Context, config *config.ZooKeeper) error {
|
||||||
|
// Temporary disable logging
|
||||||
|
originalLogger := log.Default().Writer()
|
||||||
|
log.SetOutput(ioutil.Discard)
|
||||||
|
defer log.SetOutput(originalLogger) // Ensure logging is restored
|
||||||
return zookeeper.Check(ctx, config.Address, config.Schema, zookeeper.WithUserNameAndPassword(config.Username, config.Password))
|
return zookeeper.Check(ctx, config.Address, config.Schema, zookeeper.WithUserNameAndPassword(config.Username, config.Password))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user