Pārlūkot izejas kodu

Make sure to reset commit count in the cache on mirror syncing (#4720)

* Make sure to reset commit count in the cache on mirror syncing

* reset count of commits in all branches
tags/v1.6.0-dev
Lanre Adelowo pirms 5 gadiem
vecāks
revīzija
33bc2ebdfa
1 mainītis faili ar 11 papildinājumiem un 0 dzēšanām
  1. 11
    0
      models/repo_mirror.go

+ 11
- 0
models/repo_mirror.go Parādīt failu

@@ -9,6 +9,7 @@ import (
"time"

"code.gitea.io/git"
"code.gitea.io/gitea/modules/cache"
"code.gitea.io/gitea/modules/log"
"code.gitea.io/gitea/modules/process"
"code.gitea.io/gitea/modules/setting"
@@ -180,6 +181,16 @@ func (m *Mirror) runSync() bool {
}
}

branches, err := m.Repo.GetBranches()
if err != nil {
log.Error(4, "GetBranches: %v", err)
return false
}

for i := range branches {
cache.Remove(m.Repo.GetCommitsCountCacheKey(branches[i].Name, true))
}

m.UpdatedUnix = util.TimeStampNow()
return true
}

Notiek ielāde…
Atcelt
Saglabāt