Fix registry cache issues.

This commit is contained in:
Ben Johnson
2013-10-13 21:09:56 -06:00
parent 013d07bc2a
commit d44fd6661a
6 changed files with 27 additions and 8 deletions

View File

@@ -56,7 +56,7 @@ func (r *Registry) Unregister(name string, commitIndex uint64, term uint64) erro
defer r.Unlock()
// Remove from cache.
delete(r.nodes, name)
// delete(r.nodes, name)
// Remove the key from the store.
_, err := r.store.Delete(path.Join(RegistryKey, name), false, commitIndex, term)
@@ -165,6 +165,11 @@ func (r *Registry) PeerURLs(leaderName, selfName string) []string {
return urls
}
// Removes a node from the cache.
func (r *Registry) Invalidate(name string) {
delete(r.nodes, name)
}
// Loads the given node by name from the store into the cache.
func (r *Registry) load(name string) {
if name == "" {