MCPcopy Create free account
hub / github.com/dadgar/onecache / replicateTouch

Method replicateTouch

onecache/replicator.go:385–406  ·  view source on GitHub ↗

replicateTouch replicates a key due to it being touched.

(key, peer string)

Source from the content-addressed store, hash-verified

383
384// replicateTouch replicates a key due to it being touched.
385func (p *peerSync) replicateTouch(key, peer string) error {
386
387 // Get the experation time.
388 data, err := p.r.n.data.Get(key)
389 if err != nil {
390 return err
391 }
392
393 var resp struct{}
394 sargs := StorageArgs{
395 Key: key,
396 Exp: data.Exp,
397 ExplicitPeer: peer,
398 }
399 v := ReplicaVersion{
400 Peer: p.name,
401 Version: time.Now().UnixNano(),
402 }
403 args := ReplicaStorageArgs{sargs, v}
404
405 return p.r.n.server.ReplicaTouch(args, &resp)
406}
407
408// replicateDelete replicates the deletion of a key.
409func (p *peerSync) replicateDelete(key, peer string) error {

Callers 1

replicateMethod · 0.95

Calls 2

ReplicaTouchMethod · 0.80
GetMethod · 0.45

Tested by

no test coverage detected