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
7bee08b4
Commit
7bee08b4
authored
Feb 17, 2017
by
Robert Raposa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Enhance logging.
parent
4eabd8b4
Show 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 @
7bee08b4
...
...
@@ -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