summaryrefslogtreecommitdiffstats
path: root/modules/notification/indexer
diff options
context:
space:
mode:
authorzeripath <art27@cantab.net>2020-05-08 15:58:40 +0100
committerGitHub <noreply@github.com>2020-05-08 15:58:40 +0100
commit6f6edb8fab5550a879a09af9530dd10d5c8d7f6d (patch)
tree502819a840f4a7e210c58a30a0f5d709d97d1e08 /modules/notification/indexer
parent866ce126ecce2f28f4fc25648cf4bd74679c00cc (diff)
downloadgitea-6f6edb8fab5550a879a09af9530dd10d5c8d7f6d.tar.gz
gitea-6f6edb8fab5550a879a09af9530dd10d5c8d7f6d.zip
Add NotifySyncPushCommits to indexer notifier (#11309)
Thanks to @simon-on-gh for tracking down the issue. Fix #11200 Signed-off-by: Andrew Thornton <art27@cantab.net>
Diffstat (limited to 'modules/notification/indexer')
-rw-r--r--modules/notification/indexer/indexer.go9
1 files changed, 9 insertions, 0 deletions
diff --git a/modules/notification/indexer/indexer.go b/modules/notification/indexer/indexer.go
index 6caae6fa65..f292d7339b 100644
--- a/modules/notification/indexer/indexer.go
+++ b/modules/notification/indexer/indexer.go
@@ -132,6 +132,15 @@ func (r *indexerNotifier) NotifyPushCommits(pusher *models.User, repo *models.Re
}
}
+func (r *indexerNotifier) NotifySyncPushCommits(pusher *models.User, repo *models.Repository, refName, oldCommitID, newCommitID string, commits *repository.PushCommits) {
+ if setting.Indexer.RepoIndexerEnabled && refName == git.BranchPrefix+repo.DefaultBranch {
+ code_indexer.UpdateRepoIndexer(repo)
+ }
+ if err := stats_indexer.UpdateRepoIndexer(repo); err != nil {
+ log.Error("stats_indexer.UpdateRepoIndexer(%d) failed: %v", repo.ID, err)
+ }
+}
+
func (r *indexerNotifier) NotifyIssueChangeContent(doer *models.User, issue *models.Issue, oldContent string) {
issue_indexer.UpdateIssueIndexer(issue)
}