aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorzeripath <art27@cantab.net>2022-02-25 04:22:09 +0000
committerGitHub <noreply@github.com>2022-02-24 23:22:09 -0500
commitf1c6cf7c51929406a198ec35403fc3ea790ebeb3 (patch)
tree13e0703255f8c0b0c420dfef5836692cf68da980
parent2f2f11e45df82797562b67ff0e5b5ac9aaab625d (diff)
downloadgitea-f1c6cf7c51929406a198ec35403fc3ea790ebeb3.tar.gz
gitea-f1c6cf7c51929406a198ec35403fc3ea790ebeb3.zip
Prevent Stats Indexer reporting error if repo dir missing (#18870)
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>
-rw-r--r--modules/indexer/stats/db.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/modules/indexer/stats/db.go b/modules/indexer/stats/db.go
index e425b95d20..513f2270da 100644
--- a/modules/indexer/stats/db.go
+++ b/modules/indexer/stats/db.go
@@ -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()