diff --git a/pkg/mining/miner.go b/pkg/mining/miner.go index 082143d..bc66efb 100644 --- a/pkg/mining/miner.go +++ b/pkg/mining/miner.go @@ -123,8 +123,7 @@ func (b *BaseMiner) GetName() string { return b.Name } -// GetPath returns the base installation directory for the miner type. -// It uses the stable ExecutableName field to ensure the correct path. +// path := miner.GetPath() // e.g. "/home/user/.local/share/lethean-desktop/miners/xmrig" func (b *BaseMiner) GetPath() string { dataPath, err := xdg.DataFile(fmt.Sprintf("lethean-desktop/miners/%s", b.ExecutableName)) if err != nil { @@ -137,15 +136,14 @@ func (b *BaseMiner) GetPath() string { return dataPath } -// GetBinaryPath returns the full path to the miner's executable file. +// binary := miner.GetBinaryPath() // e.g. "/home/user/.local/share/lethean-desktop/miners/xmrig/xmrig" func (b *BaseMiner) GetBinaryPath() string { b.mu.RLock() defer b.mu.RUnlock() return b.MinerBinary } -// Stop terminates the miner process gracefully. -// It first tries SIGTERM to allow cleanup, then SIGKILL if needed. +// if err := miner.Stop(); err != nil { log.Warn("stop failed", ...) } func (b *BaseMiner) Stop() error { b.mu.Lock()