Files
ARTEX/agent/coverage.go
T
protonmatter ce218c4b16 Leave asset-coverage tools available when the flag read fails.
A missing task stays enabled. A database error is returned to the caller and logged, instead of being treated as a reason to hide the tools.
2026-11-17 13:04:36 -05:00

23 lines
607 B
Go

package agent
import (
"log"
"github.com/Autumn-27/artex/db"
)
// coverageOn reports whether asset-coverage tools stay available for this task.
// A nil store is the historical default (enabled). A database error is logged and
// treated as enabled so a transient read failure does not drop the tools mid-run.
func coverageOn(as *db.AssetStore, taskID int64) bool {
if as == nil {
return true
}
enabled, err := as.CoverageEnabled(taskID)
if err != nil {
log.Printf("[coverage] task %d: reading the coverage flag failed; leaving coverage on: %v", taskID, err)
return true
}
return enabled
}