replicateTouch replicates a key due to it being touched.
(key, peer string)
| 383 | |
| 384 | // replicateTouch replicates a key due to it being touched. |
| 385 | func (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. |
| 409 | func (p *peerSync) replicateDelete(key, peer string) error { |
no test coverage detected