Commit efc08c24 authored by Terri Chu's avatar Terri Chu

Remove unused params from ElasticCommitIndexerWorker

parent 92bacbbc
......@@ -9,7 +9,7 @@ module Elastic
delegate(:delete_index_for_commits_and_blobs, :elastic_search, to: :__elasticsearch__)
def index_wiki_blobs
ElasticCommitIndexerWorker.perform_async(project.id, nil, nil, true)
ElasticCommitIndexerWorker.perform_async(project.id, true)
end
end
end
......@@ -668,7 +668,7 @@ module EE
# Index the wiki repository after import of non-forked projects only, the project repository is indexed
# in ProjectImportState so ElasticSearch will get project repository changes when mirrors are updated
ElasticCommitIndexerWorker.perform_async(id, nil, nil, true) if use_elasticsearch? && !forked?
ElasticCommitIndexerWorker.perform_async(id, true) if use_elasticsearch? && !forked?
end
def log_geo_updated_events
......
......@@ -28,7 +28,7 @@ module Elastic
maintain_indexed_associations(project, INDEXED_PROJECT_ASSOCIATIONS)
ElasticCommitIndexerWorker.perform_async(project.id)
ElasticCommitIndexerWorker.perform_async(project.id, nil, nil, true)
ElasticCommitIndexerWorker.perform_async(project.id, true)
end
end
end
......
......@@ -14,12 +14,10 @@ class ElasticCommitIndexerWorker
# Performs the commits and blobs indexation
#
# project_id - The ID of the project to index
# oldrev @deprecated - The revision to start indexing at (default: INDEXED_SHA)
# newrev @deprecated - The revision to stop indexing at (default: HEAD)
# wiki - Treat this project as a Wiki
#
# The indexation will cover all commits within INDEXED_SHA..HEAD
def perform(project_id, oldrev = nil, newrev = nil, wiki = false)
def perform(project_id, wiki = false)
return true unless Gitlab::CurrentSettings.elasticsearch_indexing?
project = Project.find(project_id)
......
......@@ -31,7 +31,7 @@ RSpec.describe ProjectWiki, :elastic do
end
it 'indexes' do
expect(ElasticCommitIndexerWorker).to receive(:perform_async).with(project.id, nil, nil, true)
expect(ElasticCommitIndexerWorker).to receive(:perform_async).with(project.id, true)
project.wiki.index_wiki_blobs
end
......
......@@ -1888,7 +1888,7 @@ RSpec.describe Project do
end
it 'schedules a full index of the wiki repository' do
expect(ElasticCommitIndexerWorker).to receive(:perform_async).with(project.id, nil, nil, true)
expect(ElasticCommitIndexerWorker).to receive(:perform_async).with(project.id, true)
project.after_import
end
......
......@@ -10,7 +10,7 @@ RSpec.describe Elastic::ProcessInitialBookkeepingService do
it 'calls initial project indexing' do
expect(described_class).to receive(:maintain_indexed_associations).with(project, Elastic::ProcessInitialBookkeepingService::INDEXED_PROJECT_ASSOCIATIONS)
expect(ElasticCommitIndexerWorker).to receive(:perform_async).with(project.id)
expect(ElasticCommitIndexerWorker).to receive(:perform_async).with(project.id, nil, nil, true)
expect(ElasticCommitIndexerWorker).to receive(:perform_async).with(project.id, true)
described_class.backfill_projects!(project)
end
......
......@@ -15,7 +15,7 @@ RSpec.describe ElasticCommitIndexerWorker do
it 'runs indexer' do
expect_any_instance_of(Gitlab::Elastic::Indexer).to receive(:run)
subject.perform(project.id, '0000', '0000')
subject.perform(project.id, false)
end
it 'returns true if ES disabled' do
......@@ -32,7 +32,7 @@ RSpec.describe ElasticCommitIndexerWorker do
expect(indexer).to receive(:run)
expect(Gitlab::Elastic::Indexer).to receive(:new).with(project, wiki: true).and_return(indexer)
subject.perform(project.id, nil, nil, true)
subject.perform(project.id, true)
end
it 'does not run index when it is locked' do
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment