removed reconn
Some checks failed
lint / lint (pull_request) Failing after 56s
test / test (pull_request) Successful in 2m28s

This commit is contained in:
2025-05-21 11:36:28 +03:00
parent 9dd6efddf9
commit 397f5414b3

13
kgo.go
View File

@@ -280,19 +280,6 @@ func (k *Broker) Publish(ctx context.Context, topic string, msg *broker.Message,
}
func (k *Broker) publish(ctx context.Context, msgs []*broker.Message, opts ...broker.PublishOption) error {
k.Lock()
if k.connected.Load() == 0 {
c, _, err := k.connect(ctx, k.kopts...)
if err != nil {
k.Unlock()
return err
}
k.c.Close()
k.c = c
k.connected.Store(1)
}
k.Unlock()
options := broker.NewPublishOptions(opts...)
records := make([]*kgo.Record, 0, len(msgs))
var errs []string