Skip to content

Commit

Permalink
Prevent Stats Indexer reporting error if repo dir missing (#18870)
Browse files Browse the repository at this point in the history
Repositories missing their directory should not report an error from the stats
indexer.

Close #18847

Signed-off-by: Andrew Thornton <art27@cantab.net>

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
  • Loading branch information
zeripath and lunny committed Feb 25, 2022
1 parent 2f2f11e commit f1c6cf7
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions modules/indexer/stats/db.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ func (db *DBIndexer) Index(id int64) error {

gitRepo, err := git.OpenRepositoryCtx(ctx, repo.RepoPath())
if err != nil {
if err.Error() == "no such file or directory" {
return nil
}
return err
}
defer gitRepo.Close()
Expand Down

0 comments on commit f1c6cf7

Please sign in to comment.