Remove clock goroutine

This is a followup for https://github.com/9seconds/mtg/issues/412 it
makes sense to manage timers inplace instead of creating for new
goroutines: saves memory
This commit is contained in:
9seconds
2026-03-29 15:39:33 +02:00
parent 822560bede
commit 0c030646f9
6 changed files with 17 additions and 139 deletions
+3 -3
View File
@@ -47,7 +47,7 @@ type Ganger struct {
drs bool
stats *Stats
stats Stats
durations []time.Duration
certSizes []int
@@ -113,7 +113,7 @@ func (g *Ganger) run() {
scoutCollectedChan := make(chan scoutRaidResult)
currentScoutCollectedChan := scoutCollectedChan
updatedStatsChan := make(chan *Stats)
updatedStatsChan := make(chan Stats)
g.wg.Go(func() {
g.runScoutRaid(scoutCollectedChan)
@@ -256,7 +256,7 @@ func NewGanger(
scoutRaidEach: scoutEach,
scoutRaidRepeats: scoutRepeats,
drs: drs,
stats: &Stats{
stats: Stats{
k: StatsDefaultK,
lambda: StatsDefaultLambda,
drs: drs,