From 9c4a89a7c815515f51e36119db899f9274f31ea8 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 (*long_tasks*) is kept for **long running** tasks. All current *batch* tasks are explicitly assigned to the **long_tasks** queue as well. Signed-off-by: Tomas Cohen Arazi Signed-off-by: Kyle M Hall Signed-off-by: Martin Renvoize Signed-off-by: Fridolin Somers --- 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..51648aecec 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 => 'long_tasks', } ); } diff --git a/Koha/BackgroundJob/BatchDeleteAuthority.pm b/Koha/BackgroundJob/BatchDeleteAuthority.pm index 0f2151976f..3983ffd1e4 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 => 'long_tasks', }); } diff --git a/Koha/BackgroundJob/BatchDeleteBiblio.pm b/Koha/BackgroundJob/BatchDeleteBiblio.pm index 0c95c6352c..efd9af2bf4 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 => 'long_tasks', }); } diff --git a/Koha/BackgroundJob/BatchDeleteItem.pm b/Koha/BackgroundJob/BatchDeleteItem.pm index b4bcbfa6a8..da6039dd9e 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 => 'long_tasks', } ); } diff --git a/Koha/BackgroundJob/BatchUpdateAuthority.pm b/Koha/BackgroundJob/BatchUpdateAuthority.pm index 482acf892c..5d8bf7edb7 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 => 'long_tasks', }); } diff --git a/Koha/BackgroundJob/BatchUpdateBiblio.pm b/Koha/BackgroundJob/BatchUpdateBiblio.pm index 21e938f191..e8022c0d49 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 => 'long_tasks', }); } diff --git a/Koha/BackgroundJob/BatchUpdateItem.pm b/Koha/BackgroundJob/BatchUpdateItem.pm index 7e7ae38fb2..d01aed7f39 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 => 'long_tasks', } ); } diff --git a/misc/background_jobs_worker.pl b/misc/background_jobs_worker.pl index c9495d0e87..5730d7c8ae 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 + long_tasks =back -- 2.39.5