mirror of
https://github.com/sourcebot-dev/sourcebot.git
synced 2025-12-12 12:25:22 +00:00
fix(repoManager): Don't fetch files for each repo on validation (#414)
This commit is contained in:
parent
48269781b7
commit
e47fdb51db
1 changed files with 1 additions and 2 deletions
|
|
@ -552,8 +552,8 @@ export class RepoManager implements IRepoManager {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const files = readdirSync(this.ctx.indexPath);
|
||||||
const reposToReindex: number[] = [];
|
const reposToReindex: number[] = [];
|
||||||
|
|
||||||
for (const repo of indexedRepos) {
|
for (const repo of indexedRepos) {
|
||||||
const shardPrefix = getShardPrefix(repo.orgId, repo.id);
|
const shardPrefix = getShardPrefix(repo.orgId, repo.id);
|
||||||
|
|
||||||
|
|
@ -561,7 +561,6 @@ export class RepoManager implements IRepoManager {
|
||||||
// would need to know how many total shards are expected for this repo
|
// would need to know how many total shards are expected for this repo
|
||||||
let hasShards = false;
|
let hasShards = false;
|
||||||
try {
|
try {
|
||||||
const files = readdirSync(this.ctx.indexPath);
|
|
||||||
hasShards = files.some(file => file.startsWith(shardPrefix));
|
hasShards = files.some(file => file.startsWith(shardPrefix));
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
logger.error(`Failed to read index directory ${this.ctx.indexPath}: ${error}`);
|
logger.error(`Failed to read index directory ${this.ctx.indexPath}: ${error}`);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue