Files
wehub-resource-sync a06f331eb8
CI / benchmark (push) Has been skipped
install-script / posix-syntax (push) Successful in 6m1s
CI / build-onnx (push) Failing after 6m43s
init-smoke / dry-run (push) Failing after 15m57s
security / govulncheck (push) Has been cancelled
security / trivy-fs (push) Has been cancelled
CI / test (1.26, ubuntu-latest) (push) Has been cancelled
Scorecard supply-chain security / Scorecard analysis (push) Has been cancelled
CI / test (1.26, macos-latest) (push) Has been cancelled
CI / build-windows (push) Has been cancelled
CI / lint (push) Has been cancelled
install-script / powershell-syntax (push) Has been cancelled
install-script / install (macos-14) (push) Has been cancelled
install-script / install (ubuntu-latest) (push) Has been cancelled
chore: import upstream snapshot with attribution
2026-07-13 12:33:42 +08:00

24 lines
802 B
Go

package resolver
import (
"os"
"strings"
)
// backendResolverEnabled reports whether the resolver should consult
// graph.BackendResolver before running its Go-side worker pool.
// Default on for the disk-backed daemon: the backend resolver runs
// one query per rule rather than one round-trip per unresolved edge.
// With the multi-repo encoding exposing 100k+ `unresolved::*` edges
// at warmup, the per-edge Go path is the difference between a sub-
// 10-minute warmup and a hang / OOM. Set GORTEX_BACKEND_RESOLVER=0
// to opt back out for the edge case where a small in-memory corpus
// can be heuristically resolved faster in RAM.
func backendResolverEnabled() bool {
v := os.Getenv("GORTEX_BACKEND_RESOLVER")
if v == "0" || strings.EqualFold(v, "false") {
return false
}
return true
}