From 36772abfbe164e48b3095e27d817504af2ab0bbe Mon Sep 17 00:00:00 2001 From: Kyle Hall Date: Thu, 5 Jan 2023 11:35:42 -0500 Subject: [PATCH] Bug 32573: Send ACK message to RabbitMQ before handling the job Splitting off this functionality from bug 32558. This is the comment that started this discussion: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32558#c15 From the O'Reilly book Mobile and Web Messaging: Signed-off-by: Tomas Cohen Arazi (cherry picked from commit b3c5bd02e15e5f2e5c0eae3b06f26083b4856f3d) Signed-off-by: Matt Blenkinsop (cherry picked from commit 0f7b8008f7f1158f9b5aff9fa8c5b58cff28f000) Signed-off-by: Lucas Gass (cherry picked from commit 2fd293fa6ec7a28ad1319a8036f06cbe1c07a9f5) Signed-off-by: Arthur Suzuki --- misc/background_jobs_worker.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/misc/background_jobs_worker.pl b/misc/background_jobs_worker.pl index 538cd93110..e0ee328e72 100755 --- a/misc/background_jobs_worker.pl +++ b/misc/background_jobs_worker.pl @@ -64,8 +64,8 @@ while (1) { # It could work in a first step, but then we will want to handle job that will be created from the message received my $job = Koha::BackgroundJobs->find($args->{job_id}); + $conn->ack( { frame => $frame } ); # Acknowledge the message was received process_job( $job, $args ); - $conn->ack( { frame => $frame } ); # FIXME depending on success? } else { my $jobs = Koha::BackgroundJobs->search({ status => 'new' }); -- 2.20.1