Skip to content

Commit 49f7391

Browse files
committed
chore: remove kontroll use existing lodash.debounce from main head
1 parent 2cf1218 commit 49f7391

File tree

3 files changed

+36
-44
lines changed

3 files changed

+36
-44
lines changed

pnpm-lock.yaml

Lines changed: 30 additions & 32 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -381,7 +381,6 @@
381381
"i18next": "^24.2.2",
382382
"ignore": "^7.0.3",
383383
"isbinaryfile": "^5.0.2",
384-
"kontroll": "^1.0.5",
385384
"lodash.debounce": "^4.0.8",
386385
"mammoth": "^1.8.0",
387386
"monaco-vscode-textmate-theme-converter": "^0.1.7",

src/services/mcp/McpHub.ts

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ import * as fs from "fs/promises"
1616
import * as path from "path"
1717
import * as vscode from "vscode"
1818
import { z } from "zod"
19+
import debounce from "lodash.debounce"
1920
import { t } from "../../i18n"
20-
import { countdown } from "kontroll"
2121

2222
import { ClineProvider } from "../../core/webview/ClineProvider"
2323
import { GlobalFileNames } from "../../shared/globalFileNames"
@@ -113,6 +113,10 @@ export class McpHub {
113113
isConnecting: boolean = false
114114
private refCount: number = 0 // Reference counter for active clients
115115

116+
private debouncedReloadLogic = debounce(() => {
117+
this.reloadMcpServers()
118+
}, 1000)
119+
116120
constructor(provider: ClineProvider) {
117121
this.providerRef = new WeakRef(provider)
118122
this.watchMcpSettingsFile()
@@ -355,16 +359,7 @@ export class McpHub {
355359
}
356360

357361
public async reloadMcpServers() {
358-
if (this.isConnecting) {
359-
countdown(
360-
2000,
361-
() => {
362-
this.reloadMcpServers()
363-
},
364-
{ key: "reloadMcpServers" },
365-
)
366-
return
367-
}
362+
if (this.isConnecting) this.debouncedReloadLogic()
368363

369364
await this.initializeProjectMcpServers()
370365
await this.initializeGlobalMcpServers()

0 commit comments

Comments
 (0)