mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 14:20:44 +00:00
build: update tsgo native preview
This commit is contained in:
@@ -46,7 +46,7 @@ export function applyLocalTsgoPolicy(args, env, hostResources) {
|
||||
);
|
||||
}
|
||||
|
||||
if (shouldThrottleLocalHeavyChecks(nextEnv, hostResources)) {
|
||||
if (shouldThrottleLocalHeavyChecks(nextEnv, hostResources, "auto")) {
|
||||
insertBeforeSeparator(nextArgs, "--singleThreaded");
|
||||
insertBeforeSeparator(nextArgs, "--checkers", "1");
|
||||
|
||||
@@ -145,12 +145,12 @@ export function shouldAcquireLocalHeavyCheckLockForTsgo(args, env = process.env)
|
||||
);
|
||||
}
|
||||
|
||||
export function shouldThrottleLocalHeavyChecks(env, hostResources) {
|
||||
export function shouldThrottleLocalHeavyChecks(env, hostResources, defaultMode = "throttled") {
|
||||
if (!isLocalCheckEnabled(env)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
const mode = readLocalCheckMode(env);
|
||||
const mode = readLocalCheckMode(env, defaultMode);
|
||||
if (mode === "throttled") {
|
||||
return true;
|
||||
}
|
||||
@@ -298,7 +298,7 @@ function insertBeforeSeparator(args, ...items) {
|
||||
args.splice(insertIndex, 0, ...items);
|
||||
}
|
||||
|
||||
function readLocalCheckMode(env) {
|
||||
function readLocalCheckMode(env, defaultMode) {
|
||||
const raw = env.OPENCLAW_LOCAL_CHECK_MODE?.trim().toLowerCase();
|
||||
if (raw === "throttled" || raw === "low-memory") {
|
||||
return "throttled";
|
||||
@@ -306,9 +306,7 @@ function readLocalCheckMode(env) {
|
||||
if (raw === "full" || raw === "fast") {
|
||||
return "full";
|
||||
}
|
||||
// Keep local heavy checks conservative by default. Developers can still opt
|
||||
// into full-speed runs explicitly with OPENCLAW_LOCAL_CHECK_MODE=full.
|
||||
return "throttled";
|
||||
return defaultMode;
|
||||
}
|
||||
|
||||
function resolveHostResources(hostResources) {
|
||||
|
||||
Reference in New Issue
Block a user