View | Details | Raw Unified | Return to bug 40820
Collapse All | Expand All

(-)a/misc/workers/background_jobs_worker.pl (-7 / +11 lines)
Lines 90-103 unless (@queues) { Link Here
90
    push @queues, 'default';
90
    push @queues, 'default';
91
}
91
}
92
92
93
my $notification_method = C4::Context->preference('JobsNotificationMethod') // 'STOMP';
94
93
my ( $conn, $error );
95
my ( $conn, $error );
94
try {
96
if ( $notification_method eq 'STOMP' ) {
95
    $conn = Koha::BackgroundJob->connect;
97
    try {
96
} catch {
98
        $conn = Koha::BackgroundJob->connect;
97
    $error = sprintf "Cannot connect to the message broker, the jobs will be processed anyway (%s)", $_;
99
    } catch {
98
};
100
        $error = sprintf "Cannot connect to the message broker, the jobs will be processed anyway (%s)", $_;
99
$error ||= "Cannot connect to the message broker, the jobs will be processed anyway" unless $conn;
101
    };
100
warn $error if $error;
102
    $error ||= "Cannot connect to the message broker, the jobs will be processed anyway" unless $conn;
103
    warn $error if $error;
104
}
101
105
102
my $pm = Parallel::ForkManager->new($max_processes);
106
my $pm = Parallel::ForkManager->new($max_processes);
103
107
(-)a/misc/workers/es_indexer_daemon.pl (-6 / +9 lines)
Lines 81-92 warn "Not using Elasticsearch" unless C4::Context->preference('SearchEngine') eq Link Here
81
81
82
my $logger = Koha::Logger->get( { interface => 'worker' } );
82
my $logger = Koha::Logger->get( { interface => 'worker' } );
83
83
84
my $notification_method = C4::Context->preference('JobsNotificationMethod') // 'STOMP';
85
84
my $conn;
86
my $conn;
85
try {
87
if ( $notification_method eq 'STOMP' ) {
86
    $conn = Koha::BackgroundJob->connect;
88
    try {
87
} catch {
89
        $conn = Koha::BackgroundJob->connect;
88
    warn sprintf "Cannot connect to the message broker, the jobs will be processed anyway (%s)", $_;
90
    } catch {
89
};
91
        warn sprintf "Cannot connect to the message broker, the jobs will be processed anyway (%s)", $_;
92
    };
93
}
90
94
91
if ($conn) {
95
if ($conn) {
92
96
93
- 

Return to bug 40820