ax(mining): rename wg to waitGroup in collectMinerStats
AX Principle 1: predictable names over short names. `wg` requires domain knowledge to decode; `waitGroup` is self-documenting. Co-Authored-By: Charon <charon@lethean.io>
This commit is contained in:
parent
2646772ed6
commit
cc829d1bc8
1 changed files with 4 additions and 4 deletions
|
|
@ -578,11 +578,11 @@ func (m *Manager) collectMinerStats() {
|
|||
now := time.Now()
|
||||
|
||||
// Collect stats from all miners in parallel
|
||||
var wg sync.WaitGroup
|
||||
var waitGroup sync.WaitGroup
|
||||
for _, mi := range miners {
|
||||
wg.Add(1)
|
||||
waitGroup.Add(1)
|
||||
go func(miner Miner, minerType string) {
|
||||
defer wg.Done()
|
||||
defer waitGroup.Done()
|
||||
defer func() {
|
||||
if r := recover(); r != nil {
|
||||
logging.Error("panic in single miner stats collection", logging.Fields{
|
||||
|
|
@ -594,7 +594,7 @@ func (m *Manager) collectMinerStats() {
|
|||
m.collectSingleMinerStats(miner, minerType, now, databaseEnabled)
|
||||
}(mi.miner, mi.minerType)
|
||||
}
|
||||
wg.Wait()
|
||||
waitGroup.Wait()
|
||||
}
|
||||
|
||||
// statsRetryCount is the number of retries for transient stats failures.
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue