From 4ff92dec1a8e9ebf74b113b5faa23c880bc183e0 Mon Sep 17 00:00:00 2001 From: Claude Date: Thu, 2 Apr 2026 10:58:14 +0100 Subject: [PATCH] ax(mining): expand abbreviated db variable names to full predictable names MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit dbCtx→databaseContext, dbCancel→databaseCancel, dbPoint→databasePoint in collectSingleMinerStats per AX principle 1 (predictable names over short names). Co-Authored-By: Charon --- pkg/mining/manager.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pkg/mining/manager.go b/pkg/mining/manager.go index 2cb43d4..c3a971c 100644 --- a/pkg/mining/manager.go +++ b/pkg/mining/manager.go @@ -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