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
1d1b88e1
Commit
1d1b88e1
authored
Feb 18, 2016
by
Valery Sizov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[ES indexer] Add NOT_INDEXED_ONLY option
parent
9c0b1aa1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
3 deletions
+11
-3
lib/tasks/gitlab/elastic.rake
lib/tasks/gitlab/elastic.rake
+11
-3
No files found.
lib/tasks/gitlab/elastic.rake
View file @
1d1b88e1
...
...
@@ -4,7 +4,15 @@ namespace :gitlab do
task
index_repositories: :environment
do
Repository
.
__elasticsearch__
.
create_index!
projects
=
apply_project_filters
(
Project
)
projects
=
if
ENV
[
'NOT_INDEXED_ONLY'
]
Project
.
includes
(
:index_status
).
where
(
"index_statuses.id IS NULL"
).
references
(
:index_statuses
)
else
Project
end
projects
=
apply_project_filters
(
projects
)
projects
.
find_each
do
|
project
|
if
project
.
repository
.
exists?
&&
!
project
.
repository
.
empty?
...
...
@@ -84,11 +92,11 @@ namespace :gitlab do
def
apply_project_filters
(
projects
)
if
ENV
[
'ID_FROM'
]
projects
=
projects
.
where
(
"id >= ?"
,
ENV
[
'ID_FROM'
])
projects
=
projects
.
where
(
"
projects.
id >= ?"
,
ENV
[
'ID_FROM'
])
end
if
ENV
[
'ID_TO'
]
projects
=
projects
.
where
(
"id <= ?"
,
ENV
[
'ID_TO'
])
projects
=
projects
.
where
(
"
projects.
id <= ?"
,
ENV
[
'ID_TO'
])
end
projects
...
...
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