mirror of
https://github.com/openclaw/openclaw.git
synced 2026-07-09 15:59:30 +00:00
fix(crabbox): reclaim sparse reused leases
This commit is contained in:
parent
023394000c
commit
ca5905eb90
2 changed files with 16 additions and 0 deletions
|
|
@ -2675,6 +2675,20 @@ function assertFullCheckoutAvailableBeforeExit(dir) {
|
|||
return false;
|
||||
}
|
||||
|
||||
function injectFullCheckoutLeaseReclaim(commandArgs) {
|
||||
if (
|
||||
commandArgs[0] !== "run" ||
|
||||
!hasOption(commandArgs, "--id") ||
|
||||
hasOption(commandArgs, "--reclaim")
|
||||
) {
|
||||
return commandArgs;
|
||||
}
|
||||
const normalizedArgs = [...commandArgs];
|
||||
const { optionEnd } = runCommandBounds(normalizedArgs);
|
||||
normalizedArgs.splice(optionEnd, 0, "--reclaim");
|
||||
return normalizedArgs;
|
||||
}
|
||||
|
||||
const version = checkedOutput(binary, ["--version"]);
|
||||
const help = checkedOutput(binary, ["run", "--help"]);
|
||||
const providerAliases = new Map([
|
||||
|
|
@ -2856,6 +2870,7 @@ try {
|
|||
const changedGateBase = isChangedGateCommand(runWords) ? mergeBaseForChangedGate() : "";
|
||||
const checkout = prepareFullCheckoutForSync({ changedGateBase });
|
||||
fullCheckout = checkout;
|
||||
normalizedArgs = injectFullCheckoutLeaseReclaim(normalizedArgs);
|
||||
childCwd = checkout.dir;
|
||||
cleanupChildCwd = () => checkout.cleanup();
|
||||
remoteChangedGateBase = checkout.changedGateBase;
|
||||
|
|
|
|||
|
|
@ -3720,6 +3720,7 @@ describe.concurrent("scripts/crabbox-wrapper", () => {
|
|||
|
||||
expect(result.status).toBe(0);
|
||||
expect(result.stderr).toContain("syncing from temporary full checkout");
|
||||
expect(parseFakeCrabboxOutput(result).args).toContain("--reclaim");
|
||||
expect(parseFakeCrabboxOutput(result).cwd).toContain("openclaw-crabbox-sync-");
|
||||
});
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue