mirror of
https://github.com/OpenRouterTeam/spawn.git
synced 2026-04-28 03:49:31 +00:00
fix: wire maxAttempts parameter in waitForCloudInit for hetzner and digitalocean (#2380)
The `_maxAttempts` parameter in both Hetzner and DigitalOcean's `waitForCloudInit()` was silently ignored — loop bounds and early-exit checks were hardcoded. Rename to `maxAttempts` and use it consistently, matching the AWS/GCP implementations. Fixes #2378 Agent: issue-fixer Co-authored-by: B <6723574+louisgv@users.noreply.github.com> Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
f23da1523b
commit
2074211d13
3 changed files with 8 additions and 8 deletions
|
|
@ -497,7 +497,7 @@ export async function createServer(
|
|||
|
||||
// ─── SSH Execution ───────────────────────────────────────────────────────────
|
||||
|
||||
export async function waitForCloudInit(ip?: string, _maxAttempts = 60): Promise<void> {
|
||||
export async function waitForCloudInit(ip?: string, maxAttempts = 60): Promise<void> {
|
||||
const serverIp = ip || _state.serverIp;
|
||||
const selectedKeys = await ensureSshKeys();
|
||||
const keyOpts = getSshKeyOpts(selectedKeys);
|
||||
|
|
@ -509,7 +509,7 @@ export async function waitForCloudInit(ip?: string, _maxAttempts = 60): Promise<
|
|||
});
|
||||
|
||||
logStep("Waiting for cloud-init to complete...");
|
||||
for (let attempt = 1; attempt <= 60; attempt++) {
|
||||
for (let attempt = 1; attempt <= maxAttempts; attempt++) {
|
||||
try {
|
||||
const proc = Bun.spawn(
|
||||
[
|
||||
|
|
@ -541,12 +541,12 @@ export async function waitForCloudInit(ip?: string, _maxAttempts = 60): Promise<
|
|||
} catch {
|
||||
// ignore
|
||||
}
|
||||
if (attempt >= 60) {
|
||||
if (attempt >= maxAttempts) {
|
||||
logStepDone();
|
||||
logWarn("Cloud-init marker not found, continuing anyway...");
|
||||
return;
|
||||
}
|
||||
logStepInline(`Cloud-init in progress (${attempt}/60)`);
|
||||
logStepInline(`Cloud-init in progress (${attempt}/${maxAttempts})`);
|
||||
await sleep(5000);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue