mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
fix(store.go) send event to watcher after we finish modifying it
This commit is contained in:
parent
af87fa40c2
commit
a9dff278b5
@ -135,6 +135,7 @@ func (s *store) Create(nodePath string, dir bool, value string, unique bool, exp
|
||||
e, err := s.internalCreate(nodePath, dir, value, unique, false, expireTime, Create)
|
||||
|
||||
if err == nil {
|
||||
s.WatcherHub.notify(e)
|
||||
s.Stats.Inc(CreateSuccess)
|
||||
} else {
|
||||
s.Stats.Inc(CreateFail)
|
||||
@ -178,6 +179,8 @@ func (s *store) Set(nodePath string, dir bool, value string, expireTime time.Tim
|
||||
e.PrevNode = prev.Node
|
||||
}
|
||||
|
||||
s.WatcherHub.notify(e)
|
||||
|
||||
return e, nil
|
||||
}
|
||||
|
||||
@ -524,8 +527,6 @@ func (s *store) internalCreate(nodePath string, dir bool, value string, unique,
|
||||
|
||||
s.CurrentIndex = nextIndex
|
||||
|
||||
s.WatcherHub.notify(e)
|
||||
|
||||
return e, nil
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user