diff options
author | Lunny Xiao <xiaolunwen@gmail.com> | 2020-09-07 23:05:08 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-09-07 23:05:08 +0800 |
commit | 91e7ad569ac9590b521e5c4fdfb2162f528db49f (patch) | |
tree | 675316438ca6d716b87849dcf23f5ecd772176d5 /modules/indexer/code/elastic_search.go | |
parent | a722dd72db7fb6efd9ec0bf730d6b2364ef6337c (diff) | |
download | gitea-91e7ad569ac9590b521e5c4fdfb2162f528db49f.tar.gz gitea-91e7ad569ac9590b521e5c4fdfb2162f528db49f.zip |
Add queue for code indexer (#10332)
* Add queue for code indexer
* Fix lint
* Fix test
* Fix lint
* Fix bug
* Fix bug
* Fix lint
* Add noqueue
* Fix tests
* Rename noqueue to immediate
Diffstat (limited to 'modules/indexer/code/elastic_search.go')
-rw-r--r-- | modules/indexer/code/elastic_search.go | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/modules/indexer/code/elastic_search.go b/modules/indexer/code/elastic_search.go index 4f690ed806..db36c5e0c4 100644 --- a/modules/indexer/code/elastic_search.go +++ b/modules/indexer/code/elastic_search.go @@ -168,6 +168,11 @@ func (b *ElasticSearchIndexer) init() (bool, error) { } func (b *ElasticSearchIndexer) addUpdate(sha string, update fileUpdate, repo *models.Repository) ([]elastic.BulkableRequest, error) { + // Ignore vendored files in code search + if setting.Indexer.ExcludeVendored && enry.IsVendor(update.Filename) { + return nil, nil + } + stdout, err := git.NewCommand("cat-file", "-s", update.BlobSha). RunInDir(repo.RepoPath()) if err != nil { |