mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2024-01-19 02:48:24 +00:00
error handling when kafka not ready
This commit is contained in:
parent
41aba0c02c
commit
ab85118233
|
@ -37,6 +37,9 @@ func (k *KafkaQueue) initialize(hosts []string, topic string) (err error) {
|
||||||
config.Producer.Return.Successes = true
|
config.Producer.Return.Successes = true
|
||||||
config.Producer.Return.Errors = true
|
config.Producer.Return.Errors = true
|
||||||
k.producer, err = sarama.NewAsyncProducer(hosts, config)
|
k.producer, err = sarama.NewAsyncProducer(hosts, config)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
k.topic = topic
|
k.topic = topic
|
||||||
go k.handleSuccess()
|
go k.handleSuccess()
|
||||||
go k.handleError()
|
go k.handleError()
|
||||||
|
|
Loading…
Reference in a new issue