Skip to content

Commit

Permalink
fix: fix update stream
Browse files Browse the repository at this point in the history
  • Loading branch information
kianaza committed Jul 16, 2024
1 parent 3f7b729 commit 8022ab5
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions internal/natsclient/jetstream.go
Original file line number Diff line number Diff line change
Expand Up @@ -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))
}
Expand Down

0 comments on commit 8022ab5

Please sign in to comment.