Add retry mechanism to mongoDB, Redis, Kafka

This commit is contained in:
plutoyty
2023-07-12 20:21:52 +08:00
parent 40b26f9a2f
commit d41f2a7aef
3 changed files with 47 additions and 21 deletions
+3
View File
@@ -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
}