From 8022ab5855434a06f253b93a067e95df405dbef5 Mon Sep 17 00:00:00 2001 From: kianaza Date: Wed, 17 Jul 2024 00:47:14 +0330 Subject: [PATCH] fix: fix update stream --- internal/natsclient/jetstream.go | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/internal/natsclient/jetstream.go b/internal/natsclient/jetstream.go index 994cf4a..86f27aa 100644 --- a/internal/natsclient/jetstream.go +++ b/internal/natsclient/jetstream.go @@ -98,11 +98,8 @@ func (j *Jetstream) UpdateOrCreateStream() { func (j *Jetstream) updateStream(stream Stream, info *nats.StreamInfo) { subjects := append(info.Config.Subjects, stream.Subject) slices.Sort(subjects) - subjects = slices.Compact(subjects) - _, err := j.jetstream.UpdateStream(&nats.StreamConfig{ - Name: stream.Name, - Subjects: subjects, - }) + info.Config.Subjects = slices.Compact(subjects) + _, err := j.jetstream.UpdateStream(&info.Config) if err != nil { j.logger.Error("could not add subject to existing stream", zap.String("stream", stream.Name), zap.Error(err)) }