From d1eff373424a4bdd0b6838e75f6e7cb151ee5d8b Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Tue, 22 Mar 2022 14:53:31 +0100 Subject: [PATCH] Bug 30172: Ensure we can reach the server before inserting the job --- Koha/BackgroundJob.pm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Koha/BackgroundJob.pm b/Koha/BackgroundJob.pm index 2bb6f4935dd..bad39989124 100644 --- a/Koha/BackgroundJob.pm +++ b/Koha/BackgroundJob.pm @@ -100,6 +100,9 @@ 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,7 +118,6 @@ sub enqueue { $json_args = encode_json $job_args; try { - my $conn = $self->connect; # 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. # Also, here we just want the Koha instance's name, but it's not in the config... -- 2.25.1