From 91394a5b8b1211e011e528ecafe030eccb39a34e Mon Sep 17 00:00:00 2001 From: Marc Sauter Date: Tue, 10 Oct 2023 12:52:55 +0200 Subject: [PATCH] chore: fix key --- hash/watch.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/hash/watch.go b/hash/watch.go index d1c317f..ebcec6a 100644 --- a/hash/watch.go +++ b/hash/watch.go @@ -64,11 +64,11 @@ func (h *Backend) Watch(key string, w store.Watcher, ops ...store.WatchOption) e return w.OnDone() } -// WatchChan creates a watcher for a key or prefix and unmarshals events into channel. +// WatchChan creates a watcher for a key or prefix and unmarshal events into channel. // The channel elements have to implement the store.KeyOpSetter interface. func (h *Backend) WatchChan(key string, channel interface{}, errChan chan error, ops ...store.WatchOption) (store.WatchStarter, error) { if errChan == nil { - return nil, errors.New("error channal cannot be nil") + return nil, errors.New("error channel cannot be nil") } w, err := common.NewChannelSender(channel, nil, h.SplitKey) @@ -87,7 +87,7 @@ func (h *Backend) WatchChan(key string, channel interface{}, errChan chan error, ctx = opts.Context } - h.register(key, opts.Prefix, h.handleChangeNotification(w, errChan)) + h.register(h.AbsKey(key), opts.Prefix, h.handleChangeNotification(w, errChan)) // notify the caller that Watch is created and ready to receive events if opts.NotifyCreated != nil {