Skip to content

Commit

Permalink
[m3msg] Set key on value watches (#2144)
Browse files Browse the repository at this point in the history
Allows for more verbose errors.
  • Loading branch information
schallert authored Feb 12, 2020
1 parent cca763b commit 4072128
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,8 @@ func NewTrafficEnabler(opts Options) Controller {
SetInstrumentOptions(iOpts).
SetNewUpdatableFn(newUpdatableFn).
SetGetUpdateFn(getFn).
SetProcessFn(processFn)
SetProcessFn(processFn).
SetKey(opts.RuntimeKey())
return &trafficEnabler{
enabled: enabled,
value: watch.NewValue(vOptions),
Expand Down
3 changes: 2 additions & 1 deletion src/msg/producer/writer/consumer_service_writer.go
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,8 @@ func (w *consumerServiceWriterImpl) Init(t initType) error {
SetInstrumentOptions(w.opts.InstrumentOptions()).
SetNewUpdatableFn(updatableFn).
SetGetUpdateFn(getFn).
SetProcessFn(w.processFn)
SetProcessFn(w.processFn).
SetKey(w.opts.TopicName())
w.value = watch.NewValue(vOptions)
err := w.value.Watch()
if err == nil {
Expand Down
3 changes: 2 additions & 1 deletion src/msg/producer/writer/writer.go
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,8 @@ func (w *writer) Init() error {
SetInstrumentOptions(w.opts.InstrumentOptions()).
SetNewUpdatableFn(newUpdatableFn).
SetGetUpdateFn(getUpdateFn).
SetProcessFn(w.processFn)
SetProcessFn(w.processFn).
SetKey(w.opts.TopicName())
w.value = watch.NewValue(vOptions)
if err := w.value.Watch(); err != nil {
return fmt.Errorf("writer init error: %v", err)
Expand Down

0 comments on commit 4072128

Please sign in to comment.