diff --git a/Go-latest.vsix b/Go-latest.vsix index 082a5f453..388d4f8dd 100644 Binary files a/Go-latest.vsix and b/Go-latest.vsix differ diff --git a/src/goMain.ts b/src/goMain.ts index f0e6e7680..41c40fc06 100644 --- a/src/goMain.ts +++ b/src/goMain.ts @@ -56,7 +56,7 @@ export function activate(ctx: vscode.ExtensionContext): void { "data": { "classification": "SystemMetaData", "purpose": "FeatureInsight" } } */ - sendTelemetryEvent('beta-testing', { version: '0.6.74', date: '01/29/2018' }); + sendTelemetryEvent('beta-testing', { version: '0.6.74', date: '01/31/2018' }); let useLangServer = vscode.workspace.getConfiguration('go')['useLanguageServer']; let langServerFlags: string[] = vscode.workspace.getConfiguration('go')['languageServerFlags'] || []; diff --git a/src/goPackages.ts b/src/goPackages.ts index a35685979..297c4c093 100644 --- a/src/goPackages.ts +++ b/src/goPackages.ts @@ -10,6 +10,7 @@ let allPkgsCache: Map; let allPkgsLastHit: number; let gopkgsRunning: boolean = false; let gopkgsSubscriptions: GopkgsDone[] = []; +let cacheTimeout: number = 5000; function gopkgs(): Promise> { let t0 = Date.now(); @@ -58,7 +59,7 @@ function gopkgs(): Promise> { } */ sendTelemetryEvent('gopkgs', {}, { timeTaken }); - + cacheTimeout = timeTaken > 5000 ? timeTaken : 5000; return resolve(pkgs); }); }); @@ -92,7 +93,7 @@ function getAllPackagesNoCache(): Promise> { * @returns Map mapping between package import path and package name */ export function getAllPackages(): Promise> { - let useCache = allPkgsCache && allPkgsLastHit && (new Date().getTime() - allPkgsLastHit) < 5000; + let useCache = allPkgsCache && allPkgsLastHit && (new Date().getTime() - allPkgsLastHit) < cacheTimeout; if (useCache) { allPkgsLastHit = new Date().getTime(); return Promise.resolve(allPkgsCache);