1
0
mirror of https://github.com/LaCasemate/fab-manager.git synced 2025-02-21 15:54:22 +01:00

add explicit result message on rake task fablab:es_build_availabilities_index

This commit is contained in:
Sylvain 2016-10-05 12:28:13 +02:00
parent 592c250b49
commit 6487ea7e08

View File

@ -134,6 +134,10 @@ namespace :fablab do
# create doctype
client.indices.put_mapping index: Availability.index_name, type: Availability.document_type, body: Availability.mappings.to_hash
# verify doctype creation was successful
if client.indices.exists_type? index: Availability.index_name, type: Availability.document_type
puts "[ElasticSearch] #{Availability.index_name}/#{Availability.document_type} successfully created with its mapping."
# index requested documents
if args.id
AvailabilityIndexerWorker.perform_async(:index, id)
@ -142,6 +146,10 @@ namespace :fablab do
AvailabilityIndexerWorker.perform_async(:index, availability_id)
end
end
else
puts "[ElasticSearch] An error occurred while creating #{Availability.index_name}/#{Availability.document_type}. Please check your ElasticSearch configuration."
puts "\nCancelling..."
end
end
desc 'recreate every versions of images'