Bugzilla – Attachment 132176 Details for
Bug 30172
Background jobs failing due to race condition
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 30172: Enqueue the job even if rabbitmq is not reachable
Bug-30172-Enqueue-the-job-even-if-rabbitmq-is-not-.patch (text/plain), 1.30 KB, created by
Jonathan Druart
on 2022-03-24 15:23:24 UTC
(
hide
)
Description:
Bug 30172: Enqueue the job even if rabbitmq is not reachable
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2022-03-24 15:23:24 UTC
Size:
1.30 KB
patch
obsolete
>From b06f3ea13f46dc41d54a2ec7049cbc25e6cc7de1 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Thu, 24 Mar 2022 16:22:51 +0100 >Subject: [PATCH] Bug 30172: Enqueue the job even if rabbitmq is not reachable > >--- > Koha/BackgroundJob.pm | 12 +++++++++--- > 1 file changed, 9 insertions(+), 3 deletions(-) > >diff --git a/Koha/BackgroundJob.pm b/Koha/BackgroundJob.pm >index bad39989124..b8c010924d5 100644 >--- a/Koha/BackgroundJob.pm >+++ b/Koha/BackgroundJob.pm >@@ -101,8 +101,6 @@ sub enqueue { > my $borrowernumber = C4::Context->userenv->{number}; # FIXME Handle non GUI calls > my $json_args = encode_json $job_args; > >- my $conn = $self->connect; # Ensure we can reach the server >- > $self->set( > { > status => 'new', >@@ -115,8 +113,16 @@ sub enqueue { > )->store; > > $job_args->{job_id} = $self->id; >- $json_args = encode_json $job_args; > >+ my $conn; >+ try { >+ $conn = $self->connect; >+ } catch { >+ warn "Cannot connect to broker " . $_; >+ }; >+ return unless $conn; >+ >+ $json_args = encode_json $job_args; > try { > # This namespace is wrong, it must be a vhost instead. > # But to do so it needs to be created on the server => much more work when a new Koha instance is created. >-- >2.25.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 30172
:
131060
|
131061
|
132023
|
132140
|
132141
|
132176
|
132177
|
132181
|
132182
|
132196
|
132197
|
132241
|
132242