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:
parent
592c250b49
commit
6487ea7e08
@ -134,6 +134,10 @@ namespace :fablab do
|
|||||||
# create doctype
|
# create doctype
|
||||||
client.indices.put_mapping index: Availability.index_name, type: Availability.document_type, body: Availability.mappings.to_hash
|
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
|
# index requested documents
|
||||||
if args.id
|
if args.id
|
||||||
AvailabilityIndexerWorker.perform_async(:index, id)
|
AvailabilityIndexerWorker.perform_async(:index, id)
|
||||||
@ -142,6 +146,10 @@ namespace :fablab do
|
|||||||
AvailabilityIndexerWorker.perform_async(:index, availability_id)
|
AvailabilityIndexerWorker.perform_async(:index, availability_id)
|
||||||
end
|
end
|
||||||
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
|
end
|
||||||
|
|
||||||
desc 'recreate every versions of images'
|
desc 'recreate every versions of images'
|
||||||
|
Loading…
x
Reference in New Issue
Block a user