better handling of intermediate topic score snapshots

This commit is contained in:
vyzo 2020-07-29 20:10:51 +03:00
parent 0f6aeb23d7
commit f160b11084
1 changed files with 3 additions and 2 deletions

View File

@ -386,14 +386,15 @@ func (ps *peerScore) inspectScoresExtended() {
if len(pstats.topics) > 0 {
pss.Topics = make(map[string]*TopicScoreSnapshot, len(pstats.topics))
for t, ts := range pstats.topics {
pss.Topics[t] = &TopicScoreSnapshot{
tss := &TopicScoreSnapshot{
FirstMessageDeliveries: ts.firstMessageDeliveries,
MeshMessageDeliveries: ts.meshMessageDeliveries,
InvalidMessageDeliveries: ts.invalidMessageDeliveries,
}
if ts.inMesh {
pss.Topics[t].TimeInMesh = ts.meshTime
tss.TimeInMesh = ts.meshTime
}
pss.Topics[t] = tss
}
}
pss.AppSpecificScore = ps.params.AppSpecificScore(p)