Skip to content

Commit

Permalink
svs: document snap nack
Browse files Browse the repository at this point in the history
  • Loading branch information
pulsejet committed Feb 6, 2025
1 parent 38010c3 commit 5eae27d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions std/sync/snapshot_node_latest.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,17 +115,17 @@ func (s *SnapshotNodeLatest) fetch(node enc.Name, boot uint64) {
// Discover the latest snapshot
s.Client.Consume(s.snapName(node, boot), func(cstate ndn.ConsumeState) {
if cstate.Error() != nil {
// Do not try too fast in case NFD returns NACK
time.AfterFunc(2*time.Second, func() {
s.handleSnapshot(node, boot, cstate)
s.handleSnap(node, boot, cstate)
})
return
} else {
s.handleSnapshot(node, boot, cstate)
s.handleSnap(node, boot, cstate)
}
})
}

func (s *SnapshotNodeLatest) handleSnapshot(node enc.Name, boot uint64, cstate ndn.ConsumeState) {
func (s *SnapshotNodeLatest) handleSnap(node enc.Name, boot uint64, cstate ndn.ConsumeState) {
s.callback(func(state SvMap[svsDataState]) (pub SvsPub, err error) {
hash := node.TlvStr()
pub.Publisher = node
Expand Down

0 comments on commit 5eae27d

Please sign in to comment.