Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
efc08c24
Commit
efc08c24
authored
May 20, 2021
by
Terri Chu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove unused params from ElasticCommitIndexerWorker
parent
92bacbbc
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
9 additions
and
11 deletions
+9
-11
ee/app/models/concerns/elastic/wiki_repositories_search.rb
ee/app/models/concerns/elastic/wiki_repositories_search.rb
+1
-1
ee/app/models/ee/project.rb
ee/app/models/ee/project.rb
+1
-1
ee/app/services/elastic/process_initial_bookkeeping_service.rb
...p/services/elastic/process_initial_bookkeeping_service.rb
+1
-1
ee/app/workers/elastic_commit_indexer_worker.rb
ee/app/workers/elastic_commit_indexer_worker.rb
+1
-3
ee/spec/models/concerns/elastic/project_wiki_spec.rb
ee/spec/models/concerns/elastic/project_wiki_spec.rb
+1
-1
ee/spec/models/project_spec.rb
ee/spec/models/project_spec.rb
+1
-1
ee/spec/services/elastic/process_initial_bookkeeping_service_spec.rb
...vices/elastic/process_initial_bookkeeping_service_spec.rb
+1
-1
ee/spec/workers/elastic_commit_indexer_worker_spec.rb
ee/spec/workers/elastic_commit_indexer_worker_spec.rb
+2
-2
No files found.
ee/app/models/concerns/elastic/wiki_repositories_search.rb
View file @
efc08c24
...
...
@@ -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
ee/app/models/ee/project.rb
View file @
efc08c24
...
...
@@ -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
...
...
ee/app/services/elastic/process_initial_bookkeeping_service.rb
View file @
efc08c24
...
...
@@ -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
...
...
ee/app/workers/elastic_commit_indexer_worker.rb
View file @
efc08c24
...
...
@@ -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
)
...
...
ee/spec/models/concerns/elastic/project_wiki_spec.rb
View file @
efc08c24
...
...
@@ -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
...
...
ee/spec/models/project_spec.rb
View file @
efc08c24
...
...
@@ -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
...
...
ee/spec/services/elastic/process_initial_bookkeeping_service_spec.rb
View file @
efc08c24
...
...
@@ -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
...
...
ee/spec/workers/elastic_commit_indexer_worker_spec.rb
View file @
efc08c24
...
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment