ax(mining): expand abbreviated db variable names to full predictable names
dbCtx→databaseContext, dbCancel→databaseCancel, dbPoint→databasePoint in collectSingleMinerStats per AX principle 1 (predictable names over short names). Co-Authored-By: Charon <charon@lethean.io>
This commit is contained in:
parent
8519413e22
commit
4ff92dec1a
1 changed files with 4 additions and 4 deletions
|
|
@ -660,16 +660,16 @@ func (m *Manager) collectSingleMinerStats(miner Miner, minerType string, now tim
|
|||
|
||||
// Persist to database if enabled
|
||||
if databaseEnabled {
|
||||
dbPoint := database.HashratePoint{
|
||||
databasePoint := database.HashratePoint{
|
||||
Timestamp: point.Timestamp,
|
||||
Hashrate: point.Hashrate,
|
||||
}
|
||||
// Create a new context for DB writes (original context is from retry loop)
|
||||
dbCtx, dbCancel := context.WithTimeout(context.Background(), statsCollectionTimeout)
|
||||
if err := database.InsertHashratePoint(dbCtx, minerName, minerType, dbPoint, database.ResolutionHigh); err != nil {
|
||||
databaseContext, databaseCancel := context.WithTimeout(context.Background(), statsCollectionTimeout)
|
||||
if err := database.InsertHashratePoint(databaseContext, minerName, minerType, databasePoint, database.ResolutionHigh); err != nil {
|
||||
logging.Warn("failed to persist hashrate", logging.Fields{"miner": minerName, "error": err})
|
||||
}
|
||||
dbCancel()
|
||||
databaseCancel()
|
||||
}
|
||||
|
||||
// Emit stats event for real-time WebSocket updates
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue