Bug 12478: abort early if there's no elasticserch definition

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jesse Weaver <jweaver@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>

Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>
This commit is contained in:
Robin Sheat 2015-10-05 17:44:14 +13:00 committed by Brendan Gallagher
parent 8365f9e9fd
commit 282ea1cdb4

View file

@ -83,6 +83,7 @@ Full documentation.
use autodie;
use Getopt::Long;
use C4::Context;
use Koha::Authority;
use Koha::BiblioUtils;
use Koha::ElasticSearch::Indexer;
@ -118,6 +119,8 @@ unless ($index_authorities || $index_biblios) {
pod2usage(1) if $help;
pod2usage( -exitstatus => 0, -verbose => 2 ) if $man;
sanity_check();
my $next;
if ($index_biblios) {
_log(1, "Indexing biblios\n");
@ -189,6 +192,13 @@ sub do_reindex {
_log( 1, "$count records indexed.\n" );
}
# Checks some basic stuff to ensure that it's sane before we start.
sub sanity_check {
# Do we have an elasticsearch block defined?
my $conf = C4::Context->config('elasticsearch');
die "No 'elasticsearch' block is defined in koha-conf.xml.\n" if ( !$conf );
}
# Output progress information.
#
# _log($level, $msg);