mirror of
https://github.com/openimsdk/open-im-server.git
synced 2026-05-06 18:15:59 +08:00
Add retry mechanism to mongoDB, Redis, Kafka
This commit is contained in:
+6
@@ -27,4 +27,10 @@ func TestNewRedis(t *testing.T) {
|
||||
fmt.Println("config load error")
|
||||
return
|
||||
}
|
||||
redis, err := NewRedis()
|
||||
if err != nil {
|
||||
fmt.Println(err)
|
||||
return
|
||||
}
|
||||
fmt.Println(redis)
|
||||
}
|
||||
|
||||
@@ -76,6 +76,9 @@ func NewKafkaProducer(addr []string, topic string) *Producer {
|
||||
//}
|
||||
time.Sleep(time.Duration(1) * time.Second)
|
||||
}
|
||||
if err != nil {
|
||||
panic(err.Error())
|
||||
}
|
||||
p.producer = producer
|
||||
return &p
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user