Skip to content

Commit 6f6edb8

Browse files
authored
Add NotifySyncPushCommits to indexer notifier (#11309)
Thanks to @simon-on-gh for tracking down the issue. Fix #11200 Signed-off-by: Andrew Thornton <[email protected]>
1 parent 866ce12 commit 6f6edb8

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

modules/notification/indexer/indexer.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,15 @@ func (r *indexerNotifier) NotifyPushCommits(pusher *models.User, repo *models.Re
132132
}
133133
}
134134

135+
func (r *indexerNotifier) NotifySyncPushCommits(pusher *models.User, repo *models.Repository, refName, oldCommitID, newCommitID string, commits *repository.PushCommits) {
136+
if setting.Indexer.RepoIndexerEnabled && refName == git.BranchPrefix+repo.DefaultBranch {
137+
code_indexer.UpdateRepoIndexer(repo)
138+
}
139+
if err := stats_indexer.UpdateRepoIndexer(repo); err != nil {
140+
log.Error("stats_indexer.UpdateRepoIndexer(%d) failed: %v", repo.ID, err)
141+
}
142+
}
143+
135144
func (r *indexerNotifier) NotifyIssueChangeContent(doer *models.User, issue *models.Issue, oldContent string) {
136145
issue_indexer.UpdateIssueIndexer(issue)
137146
}

0 commit comments

Comments
 (0)