Skip to content

Commit f8fa1ee

Browse files
authored
Fix excessive content exclusion fetches (#1230)
1 parent 2963a78 commit f8fa1ee

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/platform/ignore/node/remoteContentExclusion.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,8 @@ export class RemoteContentExclusion implements IDisposable {
104104
// We're missing entries for this repository in the cache, so we fetch it.
105105
// Or it has been more than 30 minutes so the current rules are stale
106106
if (this.shouldFetchContentExclusionRules(repoMetadata) || (Date.now() - this._lastRuleFetch > 30 * 60 * 1000)) {
107+
this._logService.trace(`Fetching content exclusions, due to ${this.shouldFetchContentExclusionRules(repoMetadata) ? 'repository change' : 'stale cache'}.`);
108+
this._lastRuleFetch = Date.now();
107109
await raceCancellationError(this.makeContentExclusionRequest(), token);
108110
}
109111

@@ -178,6 +180,7 @@ export class RemoteContentExclusion implements IDisposable {
178180
const repos = await Promise.all(repoUris.map(uri => this._gitService.getRepositoryFetchUrls(uri)));
179181
const repoInfos = repos.map(repo => this.shouldFetchContentExclusionRules(this.getRepositoryInfo(repo)));
180182
if (repoInfos.some(info => info)) {
183+
this._lastRuleFetch = Date.now();
181184
await this.makeContentExclusionRequest();
182185
}
183186
}

0 commit comments

Comments
 (0)