Make Repo Code Indexer an Unique Queue (#17515)

The functioning of the code indexer queue really only makes sense as an unique queue
and doing this allows use to simplify the indexer data to simply delete the data if
the repo is no longer in the db.

Signed-off-by: Andrew Thornton <art27@cantab.net>
This commit is contained in:
zeripath 2021-11-02 03:14:24 +00:00 committed by GitHub
parent e2995ef515
commit cb9c8184c9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 11 additions and 24 deletions

View file

@ -109,7 +109,7 @@ func (r *indexerNotifier) NotifyDeleteComment(doer *models.User, comment *models
func (r *indexerNotifier) NotifyDeleteRepository(doer *models.User, repo *models.Repository) {
issue_indexer.DeleteRepoIssueIndexer(repo)
if setting.Indexer.RepoIndexerEnabled {
code_indexer.DeleteRepoFromIndexer(repo)
code_indexer.UpdateRepoIndexer(repo)
}
}