This commit is contained in:
Sandeep Somavarapu 2025-07-03 17:56:13 +02:00 committed by GitHub
parent b2d86aa98d
commit cc1eecb9f0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 5 additions and 15 deletions

View File

@ -82,16 +82,16 @@ export abstract class AbstractMcpResourceManagementService extends Disposable im
private initialize(): Promise<void> {
if (!this.initializePromise) {
this.initializePromise = (async () => {
this.local = await this.populateLocalServer();
this.local = await this.populateLocalServers();
this.startWatching();
})();
}
return this.initializePromise;
}
private async populateLocalServer(): Promise<Map<string, ILocalMcpServer>> {
private async populateLocalServers(): Promise<Map<string, ILocalMcpServer>> {
this.logService.trace('AbstractMcpResourceManagementService#populateLocalServers', this.mcpResource.toString());
const local = new Map<string, ILocalMcpServer>();
this.logService.info('MCP Management Service: fetchInstalled', this.mcpResource.toString());
try {
const scannedMcpServers = await this.mcpResourceScannerService.scanMcpServers(this.mcpResource, this.target);
if (scannedMcpServers.servers) {
@ -118,7 +118,7 @@ export abstract class AbstractMcpResourceManagementService extends Disposable im
protected async updateLocal(): Promise<void> {
try {
const current = await this.populateLocalServer();
const current = await this.populateLocalServers();
const added: ILocalMcpServer[] = [];
const updated: ILocalMcpServer[] = [];

View File

@ -258,9 +258,7 @@ export class UserDataSyncWorkbenchService extends Disposable implements IUserDat
let value: { token: string; authenticationProviderId: string } | undefined = undefined;
if (current) {
try {
this.logService.trace('Settings Sync: Updating the token for the account', current.accountName);
const token = current.token;
this.traceOrInfo('Settings Sync: Token updated for the account', current.accountName);
value = { token, authenticationProviderId: current.authenticationProviderId };
} catch (e) {
this.logService.error(e);
@ -269,19 +267,11 @@ export class UserDataSyncWorkbenchService extends Disposable implements IUserDat
await this.userDataSyncAccountService.updateAccount(value);
}
private traceOrInfo(msg: string, ...args: any[]): void {
if (this.environmentService.isBuilt) {
this.logService.info(msg, ...args);
} else {
this.logService.trace(msg, ...args);
}
}
private updateAccountStatus(accountStatus: AccountStatus): void {
this.logService.trace(`Settings Sync: Updating the account status to ${accountStatus}`);
if (this._accountStatus !== accountStatus) {
const previous = this._accountStatus;
this.traceOrInfo(`Settings Sync: Account status changed from ${previous} to ${accountStatus}`);
this.logService.info(`Settings Sync: Account status changed from ${previous} to ${accountStatus}`);
this._accountStatus = accountStatus;
this.accountStatusContext.set(accountStatus);