diff options
| author | rari404 <[email protected]> | 2026-01-02 12:12:02 -0500 |
|---|---|---|
| committer | GitHub <[email protected]> | 2026-01-02 11:12:02 -0600 |
| commit | d8753cda02f41e5c6264effdcfe6accd2778bc62 (patch) | |
| tree | 1c64d5b02b1b37a34254606197ee5cb13dc29268 | |
| parent | 2685de2a335d374af7377cd3cb382608cde7e155 (diff) | |
| download | opencode-d8753cda02f41e5c6264effdcfe6accd2778bc62.tar.gz opencode-d8753cda02f41e5c6264effdcfe6accd2778bc62.zip | |
refactor: use Bun.sleep instead of Promise setTimeout (#6620)
| -rw-r--r-- | github/index.ts | 2 | ||||
| -rw-r--r-- | packages/opencode/src/cli/cmd/auth.ts | 2 | ||||
| -rw-r--r-- | packages/opencode/src/cli/cmd/github.ts | 2 |
3 files changed, 3 insertions, 3 deletions
diff --git a/github/index.ts b/github/index.ts index 2dcf6e754..73378894c 100644 --- a/github/index.ts +++ b/github/index.ts @@ -281,7 +281,7 @@ async function assertOpencodeConnected() { connected = true break } catch (e) {} - await new Promise((resolve) => setTimeout(resolve, 300)) + await Bun.sleep(300) } while (retry++ < 30) if (!connected) { diff --git a/packages/opencode/src/cli/cmd/auth.ts b/packages/opencode/src/cli/cmd/auth.ts index a5e52dd0e..f200ec4fe 100644 --- a/packages/opencode/src/cli/cmd/auth.ts +++ b/packages/opencode/src/cli/cmd/auth.ts @@ -36,7 +36,7 @@ async function handlePluginAuth(plugin: { auth: PluginAuth }, provider: string): const method = plugin.auth.methods[index] // Handle prompts for all auth types - await new Promise((resolve) => setTimeout(resolve, 10)) + await Bun.sleep(10) const inputs: Record<string, string> = {} if (method.prompts) { for (const prompt of method.prompts) { diff --git a/packages/opencode/src/cli/cmd/github.ts b/packages/opencode/src/cli/cmd/github.ts index 26e0fb73d..0bda43ea7 100644 --- a/packages/opencode/src/cli/cmd/github.ts +++ b/packages/opencode/src/cli/cmd/github.ts @@ -348,7 +348,7 @@ export const GithubInstallCommand = cmd({ } retries++ - await new Promise((resolve) => setTimeout(resolve, 1000)) + await Bun.sleep(1000) } while (true) s.stop("Installed GitHub app") |
