ax(mining): expand abbreviated db variable names to full predictable names
Some checks are pending
Security Scan / security (push) Waiting to run
Test / test (push) Waiting to run

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:
Claude 2026-04-02 10:58:14 +01:00
parent 8519413e22
commit 4ff92dec1a
No known key found for this signature in database
GPG key ID: AF404715446AEB41

View file

@ -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