mirror of
https://github.com/anomalyco/opencode.git
synced 2026-02-01 22:48:16 +00:00
refactor: use Bun.sleep instead of Promise setTimeout (#6620)
This commit is contained in:
@@ -281,7 +281,7 @@ async function assertOpencodeConnected() {
|
|||||||
connected = true
|
connected = true
|
||||||
break
|
break
|
||||||
} catch (e) {}
|
} catch (e) {}
|
||||||
await new Promise((resolve) => setTimeout(resolve, 300))
|
await Bun.sleep(300)
|
||||||
} while (retry++ < 30)
|
} while (retry++ < 30)
|
||||||
|
|
||||||
if (!connected) {
|
if (!connected) {
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ async function handlePluginAuth(plugin: { auth: PluginAuth }, provider: string):
|
|||||||
const method = plugin.auth.methods[index]
|
const method = plugin.auth.methods[index]
|
||||||
|
|
||||||
// Handle prompts for all auth types
|
// Handle prompts for all auth types
|
||||||
await new Promise((resolve) => setTimeout(resolve, 10))
|
await Bun.sleep(10)
|
||||||
const inputs: Record<string, string> = {}
|
const inputs: Record<string, string> = {}
|
||||||
if (method.prompts) {
|
if (method.prompts) {
|
||||||
for (const prompt of method.prompts) {
|
for (const prompt of method.prompts) {
|
||||||
|
|||||||
@@ -348,7 +348,7 @@ export const GithubInstallCommand = cmd({
|
|||||||
}
|
}
|
||||||
|
|
||||||
retries++
|
retries++
|
||||||
await new Promise((resolve) => setTimeout(resolve, 1000))
|
await Bun.sleep(1000)
|
||||||
} while (true)
|
} while (true)
|
||||||
|
|
||||||
s.stop("Installed GitHub app")
|
s.stop("Installed GitHub app")
|
||||||
|
|||||||
Reference in New Issue
Block a user