Skip to content

Commit e47fdb5

Browse files
authored
fix(repoManager): Don't fetch files for each repo on validation (#414)
1 parent 4826978 commit e47fdb5

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

packages/backend/src/repoManager.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -552,16 +552,15 @@ export class RepoManager implements IRepoManager {
552552
return;
553553
}
554554

555+
const files = readdirSync(this.ctx.indexPath);
555556
const reposToReindex: number[] = [];
556-
557557
for (const repo of indexedRepos) {
558558
const shardPrefix = getShardPrefix(repo.orgId, repo.id);
559559

560560
// TODO: this doesn't take into account if a repo has multiple shards and only some of them are missing. To support that, this logic
561561
// would need to know how many total shards are expected for this repo
562562
let hasShards = false;
563563
try {
564-
const files = readdirSync(this.ctx.indexPath);
565564
hasShards = files.some(file => file.startsWith(shardPrefix));
566565
} catch (error) {
567566
logger.error(`Failed to read index directory ${this.ctx.indexPath}: ${error}`);

0 commit comments

Comments
 (0)