From ee4b07f18b5258193cb8b3576d9498c936a4134e Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Fri, 12 Jun 2020 11:50:37 +0200 Subject: [PATCH] Bug 22417: Send message to /queue This cannot be: /queue/$namespace/$job_type I got: '/koha_kohadev/batch_biblio_record_modification' is not a valid queue destination So keeping the dash in $namespace-$job_type Signed-off-by: Tomas Cohen Arazi Signed-off-by: David Cook Signed-off-by: Marcel de Rooy Signed-off-by: Kyle M Hall Signed-off-by: Jonathan Druart --- Koha/BackgroundJob.pm | 2 +- misc/background_jobs_worker.pl | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Koha/BackgroundJob.pm b/Koha/BackgroundJob.pm index 7cf2814d76..b5bf16d2ff 100644 --- a/Koha/BackgroundJob.pm +++ b/Koha/BackgroundJob.pm @@ -53,7 +53,7 @@ sub enqueue { # Also, here we just want the Koha instance's name, but it's not in the config... # Picking a random id (memcached_namespace) from the config my $namespace = C4::Context->config('memcached_namespace'); - $conn->send_with_receipt( { destination => sprintf("%s-%s", $namespace, $job_type), body => $json_args } ) + $conn->send_with_receipt( { destination => sprintf("/queue/%s-%s", $namespace, $job_type), body => $json_args } ) or Koha::Exceptions::Exception->throw('Job has not been enqueued'); } ); diff --git a/misc/background_jobs_worker.pl b/misc/background_jobs_worker.pl index 0127a2c2f1..d1b1ffd6ac 100755 --- a/misc/background_jobs_worker.pl +++ b/misc/background_jobs_worker.pl @@ -27,7 +27,7 @@ my @job_types = qw( batch_biblio_record_modification batch_authority_record_modi # FIXME cf note in Koha::BackgroundJob about $namespace my $namespace = C4::Context->config('memcached_namespace'); for my $job_type ( @job_types ) { - $conn->subscribe({ destination => sprintf("%s-%s", $namespace, $job_type), ack => 'client' }); + $conn->subscribe({ destination => sprintf("/queue/%s-%s", $namespace, $job_type), ack => 'client' }); } while (1) { my $frame = $conn->receive_frame; -- 2.39.5