Bugzilla – Attachment 147682 Details for
Bug 33044
BackgroundJob enqueue does not return the job id if rabbit is unreachable
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 33044: Return job id if there is no connection to rabbit
Bug-33044-Return-job-id-if-there-is-no-connection-.patch (text/plain), 1.47 KB, created by
Marcel de Rooy
on 2023-03-03 08:21:40 UTC
(
hide
)
Description:
Bug 33044: Return job id if there is no connection to rabbit
Filename:
MIME Type:
Creator:
Marcel de Rooy
Created:
2023-03-03 08:21:40 UTC
Size:
1.47 KB
patch
obsolete
>From 8d8aa9df4f26f3fe5e66ed2dc8001f2cdc1ab810 Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Wed, 22 Feb 2023 18:13:35 +0000 >Subject: [PATCH] Bug 33044: Return job id if there is no connection to rabbit >Content-Type: text/plain; charset=utf-8 > >This patch simply ensures we return the job id even if we couldn't send >the job to rabbit. > >To test: >1 - In KTD: sudo service rabbitmq-server stop >2 - sudo koha-worker --stop kohadev; sudo koha-worker --queue long_tasks --stop kohadev >3 - In staff client enqueue a batch item modification - note the link to view the enqueued job has no id in the url and takes you to the main background jobs viewer >4 - Run t/db_dependent/Koha/BackgroundJob.t and notice that it fails. >5 - Apply patch >6 - Restart all >7 - Enqueue a new batch item modification >8 - Confirm the link works and has the correct id >9 - Run t/db_dependent/Koha/BackgroundJob.t; it should pass now. > >Signed-off-by: David Nind <david@davidnind.com> > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >--- > Koha/BackgroundJob.pm | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > >diff --git a/Koha/BackgroundJob.pm b/Koha/BackgroundJob.pm >index 0ba7ba46ed..f803c36b05 100644 >--- a/Koha/BackgroundJob.pm >+++ b/Koha/BackgroundJob.pm >@@ -128,7 +128,7 @@ sub enqueue { > } catch { > warn "Cannot connect to broker " . $_; > }; >- return unless $conn; >+ return $self->id unless $conn; > > $json_args = $json->encode($job_args); > try { >-- >2.30.2
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 33044
:
147178
|
147670
| 147682