diff options
| author | Chris Lu <chris.lu@gmail.com> | 2018-10-13 23:30:00 -0700 |
|---|---|---|
| committer | Chris Lu <chris.lu@gmail.com> | 2018-10-13 23:30:00 -0700 |
| commit | ab8511823383c4aeeb9e7bac7eeeb7281265bb93 (patch) | |
| tree | af9fd584e52cee9d36c2998a0e5a479d016f23f5 | |
| parent | 41aba0c02c5477699ba41e2541988a1617705417 (diff) | |
| download | seaweedfs-ab8511823383c4aeeb9e7bac7eeeb7281265bb93.tar.xz seaweedfs-ab8511823383c4aeeb9e7bac7eeeb7281265bb93.zip | |
error handling when kafka not ready
| -rw-r--r-- | weed/notification/kafka/kafka_queue.go | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/weed/notification/kafka/kafka_queue.go b/weed/notification/kafka/kafka_queue.go index f0e353f93..830709a51 100644 --- a/weed/notification/kafka/kafka_queue.go +++ b/weed/notification/kafka/kafka_queue.go @@ -37,6 +37,9 @@ func (k *KafkaQueue) initialize(hosts []string, topic string) (err error) { config.Producer.Return.Successes = true config.Producer.Return.Errors = true k.producer, err = sarama.NewAsyncProducer(hosts, config) + if err != nil { + return err + } k.topic = topic go k.handleSuccess() go k.handleError() |
