Add fleet ops dashboard, Calibrate enforcement, and dead-code cleanup.

Ship live alerts, pool status, AI monitor, remote agent commands, build manager, and uninstall flow; wire Calibrate settings (WS ping, pool traffic log, retention limits) at runtime and exclude server/data from git.
This commit is contained in:
drjones
2026-05-27 09:16:04 -07:00
parent 9d223b8137
commit df81eb7744
75 changed files with 8891 additions and 966 deletions

View File

@@ -28,6 +28,7 @@ type Pool struct {
stopCh chan struct{}
wg sync.WaitGroup
paused atomic.Bool
remotePause atomic.Bool
hashesTotal atomic.Uint64
sharesFound atomic.Uint64
@@ -91,6 +92,18 @@ func (p *Pool) ResetHashCounter() {
p.hashesTotal.Store(0)
}
func (p *Pool) PauseRemote() {
p.remotePause.Store(true)
}
func (p *Pool) ResumeRemote() {
p.remotePause.Store(false)
}
func (p *Pool) IsRemotePaused() bool {
return p.remotePause.Load()
}
func (p *Pool) resourceGuard() {
ticker := time.NewTicker(5 * time.Second)
defer ticker.Stop()
@@ -115,6 +128,13 @@ func (p *Pool) miningAllowed() bool {
}
func (p *Pool) resourcesOK() bool {
cpuPct := p.reporter.SystemCPUPercent()
if cpuPct <= 0 {
cpuPct, _ = p.reporter.Usage()
}
if p.cfg.MaxCPUUsage > 0 && cpuPct > float64(p.cfg.MaxCPUUsage) {
return false
}
freeMB := p.reporter.FreeMemoryMB()
if freeMB > 0 && freeMB < uint64(p.cfg.MinFreeRAM) {
return false
@@ -141,7 +161,7 @@ func (p *Pool) worker(id int, engine *Engine) {
default:
}
if p.paused.Load() {
if p.paused.Load() || p.remotePause.Load() {
time.Sleep(2 * time.Second)
continue
}
@@ -160,7 +180,7 @@ func (p *Pool) worker(id int, engine *Engine) {
return
default:
}
if p.paused.Load() {
if p.paused.Load() || p.remotePause.Load() {
break
}