GeezerVison is showing github.com — refactor: use Bun.sleep instead of Promise setTimeout (#6620) · sashankh/opencode@d8753cd
File tree
Expand file treeCollapse file tree
Open diff view settings
packages/opencode/src/cli/cmd
Expand file treeCollapse file tree
Open diff view settings
Collapse file
Copy file name to clipboardExpand all lines: github/index.ts +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -281,7 +281,7 @@ async function assertOpencodeConnected() { |
281 | 281 | connected = true |
282 | 282 | break |
283 | 283 | } catch (e) {} |
284 | | - await new Promise((resolve) => setTimeout(resolve, 300)) |
| 284 | + await Bun.sleep(300) |
285 | 285 | } while (retry++ < 30) |
286 | 286 |
|
287 | 287 | if (!connected) { |
|
Collapse file
Copy file name to clipboardExpand all lines: packages/opencode/src/cli/cmd/auth.ts +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -36,7 +36,7 @@ async function handlePluginAuth(plugin: { auth: PluginAuth }, provider: string): |
36 | 36 | const method = plugin.auth.methods[index] |
37 | 37 |
|
38 | 38 | // Handle prompts for all auth types |
39 | | - await new Promise((resolve) => setTimeout(resolve, 10)) |
| 39 | + await Bun.sleep(10) |
40 | 40 | const inputs: Record<string, string> = {} |
41 | 41 | if (method.prompts) { |
42 | 42 | for (const prompt of method.prompts) { |
|
Collapse file
Copy file name to clipboardExpand all lines: packages/opencode/src/cli/cmd/github.ts +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -348,7 +348,7 @@ export const GithubInstallCommand = cmd({ |
348 | 348 | } |
349 | 349 |
|
350 | 350 | retries++ |
351 | | - await new Promise((resolve) => setTimeout(resolve, 1000)) |
| 351 | + await Bun.sleep(1000) |
352 | 352 | } while (true) |
353 | 353 |
|
354 | 354 | s.stop("Installed GitHub app") |
|