Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
cs_comments_service
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
cs_comments_service
Commits
63a98fce
Commit
63a98fce
authored
Feb 17, 2017
by
Robert Raposa
Committed by
GitHub
Feb 17, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #236 from edx/robrap/improve-rake
TNL-6562: Enhance rake logging.
parents
4eabd8b4
7bee08b4
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
1 deletions
+6
-1
lib/task_helpers.rb
+6
-1
No files found.
lib/task_helpers.rb
View file @
63a98fce
...
...
@@ -148,6 +148,10 @@ module TaskHelpers
# WARNING: if an index exists with the same name as the intended alias, it
# will be deleted.
move_alias
(
alias_name
,
index_name
,
force_delete:
true
)
else
LOG
.
info
"Skipping initialization. The 'content' alias already exists. If 'rake search:validate_index' indicates "
\
"a problem with the mappings, you could either use 'rake search:rebuild_index' to reload from the db or 'rake "
\
"search:initialize[true]' to force initialization with an empty index."
end
end
...
...
@@ -168,7 +172,7 @@ module TaskHelpers
# +alias_name+:: The alias name to be validated.
def
self
.
validate_index
(
alias_name
)
if
exists_alias
(
alias_name
)
===
false
fail
"Alias
#{
alias_name
}
does not exist."
fail
"Alias
'
#{
alias_name
}
'
does not exist."
end
actual_mapping
=
Elasticsearch
::
Model
.
client
.
indices
.
get_mapping
(
index:
alias_name
).
values
[
0
]
...
...
@@ -203,6 +207,7 @@ module TaskHelpers
fail
"Document type '
#{
doc_type
}
' has missing or invalid field mappings. Missing fields:
#{
missing_fields
}
. Invalid types:
#{
invalid_field_types
}
."
end
end
LOG
.
info
"Passed: Alias '
#{
alias_name
}
' exists with up-to-date mappings."
end
end
...
...
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