Merge pull request #1410 from ripienaar/remove_advisory_config

removes the configuration from advisories
This commit is contained in:
Derek Collison
2020-05-22 07:12:51 -07:00
committed by GitHub
2 changed files with 7 additions and 11 deletions

View File

@@ -36,11 +36,9 @@ const (
// JSStreamActionAdvisory indicates that a stream was created, edited or deleted
type JSStreamActionAdvisory struct {
TypedEvent
Stream string `json:"stream"`
Action ActionAdvisoryType `json:"action"`
Template string `json:"template,omitempty"`
OriginalConfiguration *StreamConfig `json:"original,omitempty"`
NewConfiguration *StreamConfig `json:"new,omitempty"`
Stream string `json:"stream"`
Action ActionAdvisoryType `json:"action"`
Template string `json:"template,omitempty"`
}
const JSStreamActionAdvisoryType = "io.nats.jetstream.advisory.v1.stream_action"

View File

@@ -225,7 +225,7 @@ func (mset *Stream) sendDeleteAdvisoryLocked() {
}
}
func (mset *Stream) sendUpdateAdvisoryLocked(old, new StreamConfig) {
func (mset *Stream) sendUpdateAdvisoryLocked() {
if mset.sendq == nil {
return
}
@@ -236,10 +236,8 @@ func (mset *Stream) sendUpdateAdvisoryLocked(old, new StreamConfig) {
ID: nuid.Next(),
Time: time.Now().UTC(),
},
Stream: mset.config.Name,
Action: ModifyEvent,
OriginalConfiguration: &old,
NewConfiguration: &new,
Stream: mset.config.Name,
Action: ModifyEvent,
}
j, err := json.MarshalIndent(m, "", " ")
@@ -436,7 +434,7 @@ func (mset *Stream) Update(config *StreamConfig) error {
mset.config = cfg
mset.store.UpdateConfig(&cfg)
mset.sendUpdateAdvisoryLocked(o_cfg, cfg)
mset.sendUpdateAdvisoryLocked()
return nil
}