From fa71b3e8ed23f8ca27c2053110d9a5f3f4143b1b Mon Sep 17 00:00:00 2001 From: Tomas Cohen Arazi Date: Fri, 1 Apr 2022 13:56:09 +0200 Subject: [PATCH] Bug 27783: Rename queues and adjust currently defined jobs This patch renames the queues so the default is the **real-time** one, and the other (*turtle*) is kept for **slow** tasks. All current *batch* tasks are explicitly assigned to the **turtle** queue as well. Signed-off-by: Tomas Cohen Arazi --- Koha/BackgroundJob/BatchCancelHold.pm | 3 ++- Koha/BackgroundJob/BatchDeleteAuthority.pm | 3 ++- Koha/BackgroundJob/BatchDeleteBiblio.pm | 3 ++- Koha/BackgroundJob/BatchDeleteItem.pm | 3 ++- Koha/BackgroundJob/BatchUpdateAuthority.pm | 3 ++- Koha/BackgroundJob/BatchUpdateBiblio.pm | 1 + Koha/BackgroundJob/BatchUpdateItem.pm | 1 + misc/background_jobs_worker.pl | 2 +- 8 files changed, 13 insertions(+), 6 deletions(-) diff --git a/Koha/BackgroundJob/BatchCancelHold.pm b/Koha/BackgroundJob/BatchCancelHold.pm index ba85cfc63d..7f019c03e5 100644 --- a/Koha/BackgroundJob/BatchCancelHold.pm +++ b/Koha/BackgroundJob/BatchCancelHold.pm @@ -136,7 +136,8 @@ sub enqueue { $self->SUPER::enqueue( { job_size => scalar @hold_ids, - job_args => { hold_ids => \@hold_ids, reason => $args->{reason} } + job_args => { hold_ids => \@hold_ids, reason => $args->{reason} }, + queue => 'turtle', } ); } diff --git a/Koha/BackgroundJob/BatchDeleteAuthority.pm b/Koha/BackgroundJob/BatchDeleteAuthority.pm index 0f2151976f..c6679a1253 100644 --- a/Koha/BackgroundJob/BatchDeleteAuthority.pm +++ b/Koha/BackgroundJob/BatchDeleteAuthority.pm @@ -89,7 +89,8 @@ sub enqueue { $self->SUPER::enqueue({ job_size => scalar @record_ids, - job_args => {record_ids => \@record_ids,} + job_args => {record_ids => \@record_ids,}, + queue => 'turtle', }); } diff --git a/Koha/BackgroundJob/BatchDeleteBiblio.pm b/Koha/BackgroundJob/BatchDeleteBiblio.pm index 0c95c6352c..678bb3f647 100644 --- a/Koha/BackgroundJob/BatchDeleteBiblio.pm +++ b/Koha/BackgroundJob/BatchDeleteBiblio.pm @@ -174,7 +174,8 @@ sub enqueue { $self->SUPER::enqueue({ job_size => scalar @record_ids, - job_args => {record_ids => \@record_ids,} + job_args => {record_ids => \@record_ids,}, + queue => 'turtle', }); } diff --git a/Koha/BackgroundJob/BatchDeleteItem.pm b/Koha/BackgroundJob/BatchDeleteItem.pm index b4bcbfa6a8..80c58ea4f2 100644 --- a/Koha/BackgroundJob/BatchDeleteItem.pm +++ b/Koha/BackgroundJob/BatchDeleteItem.pm @@ -215,7 +215,8 @@ sub enqueue { job_args => { record_ids => \@record_ids, delete_biblios => $delete_biblios, - } + }, + queue => 'turtle', } ); } diff --git a/Koha/BackgroundJob/BatchUpdateAuthority.pm b/Koha/BackgroundJob/BatchUpdateAuthority.pm index 482acf892c..e828cb081a 100644 --- a/Koha/BackgroundJob/BatchUpdateAuthority.pm +++ b/Koha/BackgroundJob/BatchUpdateAuthority.pm @@ -130,7 +130,8 @@ sub enqueue { $self->SUPER::enqueue({ job_size => scalar @record_ids, - job_args => {mmtid => $mmtid, record_ids => \@record_ids,} + job_args => {mmtid => $mmtid, record_ids => \@record_ids,}, + queue => 'turtle', }); } diff --git a/Koha/BackgroundJob/BatchUpdateBiblio.pm b/Koha/BackgroundJob/BatchUpdateBiblio.pm index 21e938f191..e18826e4ee 100644 --- a/Koha/BackgroundJob/BatchUpdateBiblio.pm +++ b/Koha/BackgroundJob/BatchUpdateBiblio.pm @@ -136,6 +136,7 @@ sub enqueue { $self->SUPER::enqueue({ job_size => scalar @{$args->{record_ids}}, job_args => $args, + queue => 'turtle', }); } diff --git a/Koha/BackgroundJob/BatchUpdateItem.pm b/Koha/BackgroundJob/BatchUpdateItem.pm index 7e7ae38fb2..4add50bb43 100644 --- a/Koha/BackgroundJob/BatchUpdateItem.pm +++ b/Koha/BackgroundJob/BatchUpdateItem.pm @@ -157,6 +157,7 @@ sub enqueue { { job_size => scalar @record_ids, job_args => {%$args}, + queue => 'turtle', } ); } diff --git a/misc/background_jobs_worker.pl b/misc/background_jobs_worker.pl index c9495d0e87..1858bd21fb 100755 --- a/misc/background_jobs_worker.pl +++ b/misc/background_jobs_worker.pl @@ -41,7 +41,7 @@ Repeatable. Give the job queues this worker will process. The different values available are: default - index + turtle =back -- 2.35.1