From f160b11084957cb2f0c35e7191fda8dc78be6a20 Mon Sep 17 00:00:00 2001 From: vyzo Date: Wed, 29 Jul 2020 20:10:51 +0300 Subject: [PATCH] better handling of intermediate topic score snapshots --- score.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/score.go b/score.go index fda88f5..31d1232 100644 --- a/score.go +++ b/score.go @@ -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)