mirror of
https://github.com/mailgun/groupcache.git
synced 2024-11-16 14:10:04 +00:00
Logging.
This commit is contained in:
parent
73db6704c7
commit
18965b4c54
@ -28,6 +28,7 @@ import (
|
||||
"context"
|
||||
"errors"
|
||||
"strconv"
|
||||
"strings"
|
||||
"sync"
|
||||
"sync/atomic"
|
||||
"time"
|
||||
@ -297,6 +298,16 @@ func (g *Group) Set(ctx context.Context, key string, value []byte, expire time.T
|
||||
func (g *Group) Remove(ctx context.Context, key string) error {
|
||||
g.peersOnce.Do(g.initPeers)
|
||||
|
||||
var peerList []string
|
||||
for _, peer := range g.peers.GetAll() {
|
||||
peerList = append(peerList, peer.GetURL())
|
||||
}
|
||||
logrus.WithFields(logrus.Fields{
|
||||
"name": g.name,
|
||||
"peers": strings.Join(peerList, ","),
|
||||
"key": key,
|
||||
}).Info("Group.Remove()")
|
||||
|
||||
_, err := g.removeGroup.Do(key, func() (interface{}, error) {
|
||||
// Remove from key owner first
|
||||
owner, ok := g.peers.PickPeer(key)
|
||||
|
Loading…
Reference in New Issue
Block a user