Skip to content

Commit d8753cd

Browse files
authored
refactor: use Bun.sleep instead of Promise setTimeout (anomalyco#6620)
1 parent 2685de2 commit d8753cd

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

github/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,7 @@ async function assertOpencodeConnected() {
281281
connected = true
282282
break
283283
} catch (e) {}
284-
await new Promise((resolve) => setTimeout(resolve, 300))
284+
await Bun.sleep(300)
285285
} while (retry++ < 30)
286286

287287
if (!connected) {

packages/opencode/src/cli/cmd/auth.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ async function handlePluginAuth(plugin: { auth: PluginAuth }, provider: string):
3636
const method = plugin.auth.methods[index]
3737

3838
// Handle prompts for all auth types
39-
await new Promise((resolve) => setTimeout(resolve, 10))
39+
await Bun.sleep(10)
4040
const inputs: Record<string, string> = {}
4141
if (method.prompts) {
4242
for (const prompt of method.prompts) {

packages/opencode/src/cli/cmd/github.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -348,7 +348,7 @@ export const GithubInstallCommand = cmd({
348348
}
349349

350350
retries++
351-
await new Promise((resolve) => setTimeout(resolve, 1000))
351+
await Bun.sleep(1000)
352352
} while (true)
353353

354354
s.stop("Installed GitHub app")

0 commit comments

Comments
 (0)