mirror of
https://github.com/ScuroNeko/mtg.git
synced 2026-08-31 11:54:01 +03:00
Limit min number of collected stats
This commit is contained in:
@@ -94,10 +94,15 @@ func (g *Ganger) run() {
|
|||||||
return
|
return
|
||||||
case durations := <-currentScoutCollectedChan:
|
case durations := <-currentScoutCollectedChan:
|
||||||
g.durations = append(g.durations, durations...)
|
g.durations = append(g.durations, durations...)
|
||||||
|
|
||||||
if len(g.durations) > DoppelGangerMaxDurations {
|
if len(g.durations) > DoppelGangerMaxDurations {
|
||||||
g.durations = g.durations[len(g.durations)-DoppelGangerMaxDurations:]
|
g.durations = g.durations[len(g.durations)-DoppelGangerMaxDurations:]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if len(g.durations) < MinDurationsToCalculate {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
currentScoutCollectedChan = nil
|
currentScoutCollectedChan = nil
|
||||||
g.wg.Go(func() {
|
g.wg.Go(func() {
|
||||||
select {
|
select {
|
||||||
|
|||||||
Reference in New Issue
Block a user