Sfoglia il codice sorgente

Limit min number of collected stats

tags/v2.2.0^2^2
9seconds 1 mese fa
parent
commit
7aa01dcebe
1 ha cambiato i file con 5 aggiunte e 0 eliminazioni
  1. 5
    0
      mtglib/internal/doppel/ganger.go

+ 5
- 0
mtglib/internal/doppel/ganger.go Vedi File

@@ -94,10 +94,15 @@ func (g *Ganger) run() {
94 94
 			return
95 95
 		case durations := <-currentScoutCollectedChan:
96 96
 			g.durations = append(g.durations, durations...)
97
+
97 98
 			if len(g.durations) > DoppelGangerMaxDurations {
98 99
 				g.durations = g.durations[len(g.durations)-DoppelGangerMaxDurations:]
99 100
 			}
100 101
 
102
+			if len(g.durations) < MinDurationsToCalculate {
103
+				continue
104
+			}
105
+
101 106
 			currentScoutCollectedChan = nil
102 107
 			g.wg.Go(func() {
103 108
 				select {

Loading…
Annulla
Salva