Bug 40820: (follow-up) es_indexer_daemon.pl missed on 34070
The es_indexer_daemon.pl was missing handling for the case where Koha::BackgroundJob->connect() returns undef without throwing an exception (which happens when connection fails silently). This adds the missing warning for that case, matching the behavior in background_jobs_worker.pl. Test plan: 1. Set JobsNotificationMethod to 'STOMP' 2. Configure invalid STOMP settings that cause connect() to return undef 3. Run es_indexer_daemon.pl - should show connection warning 4. Verify jobs are still processed via database polling Signed-off-by: Tomás Cohen Arazi <tomascohen@theke.io> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
This commit is contained in:
parent
4ff1f4ca9c
commit
9ca0e183b5
|
|
@ -83,13 +83,15 @@ my $logger = Koha::Logger->get( { interface => 'worker' } );
|
|||
|
||||
my $notification_method = C4::Context->preference('JobsNotificationMethod') // 'STOMP';
|
||||
|
||||
my $conn;
|
||||
my ( $conn, $error );
|
||||
if ( $notification_method eq 'STOMP' ) {
|
||||
try {
|
||||
$conn = Koha::BackgroundJob->connect;
|
||||
} catch {
|
||||
warn sprintf "Cannot connect to the message broker, the jobs will be processed anyway (%s)", $_;
|
||||
$error = sprintf "Cannot connect to the message broker, the jobs will be processed anyway (%s)", $_;
|
||||
};
|
||||
$error ||= "Cannot connect to the message broker, the jobs will be processed anyway" unless $conn;
|
||||
warn $error if $error;
|
||||
}
|
||||
|
||||
if ($conn) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue