Bugzilla – Attachment 134408 Details for
Bug 27344
Implement Elastic's update_index_background using Koha::BackgroundJob
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 27344: Adapt to bug 30181 changes
Bug-27344-Adapt-to-bug-30181-changes.patch (text/plain), 2.13 KB, created by
Tomás Cohen Arazi (tcohen)
on 2022-04-29 17:23:31 UTC
(
hide
)
Description:
Bug 27344: Adapt to bug 30181 changes
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi (tcohen)
Created:
2022-04-29 17:23:31 UTC
Size:
2.13 KB
patch
obsolete
>From 1b433cec72a20e20459751f9c6682002ca89d30a Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Fri, 1 Apr 2022 12:25:56 +0200 >Subject: [PATCH] Bug 27344: Adapt to bug 30181 changes > >Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> >--- > Koha/BackgroundJob/UpdateElasticIndex.pm | 20 ++++++-------------- > 1 file changed, 6 insertions(+), 14 deletions(-) > >diff --git a/Koha/BackgroundJob/UpdateElasticIndex.pm b/Koha/BackgroundJob/UpdateElasticIndex.pm >index 700c1e0854..df98f6e085 100644 >--- a/Koha/BackgroundJob/UpdateElasticIndex.pm >+++ b/Koha/BackgroundJob/UpdateElasticIndex.pm >@@ -16,12 +16,10 @@ package Koha::BackgroundJob::UpdateElasticIndex; > # along with Koha; if not, see <http://www.gnu.org/licenses>. > > use Modern::Perl; >+ > use JSON qw( encode_json decode_json ); > >-use Koha::BackgroundJobs; > use Koha::DateUtils qw( dt_from_string ); >-use C4::Biblio; >-use C4::MarcModificationTemplates; > > use base 'Koha::BackgroundJob'; > >@@ -54,17 +52,11 @@ Process the modification. > sub process { > my ( $self, $args ) = @_; > >- my $job = Koha::BackgroundJobs->find( $args->{job_id} ); >- >- if ( !exists $args->{job_id} || !$job || $job->status eq 'cancelled' ) { >- return; >- } >- > # FIXME If the job has already been started, but started again (worker has been restart for instance) > # Then we will start from scratch and so double process the same records > > my $job_progress = 0; >- $job->started_on(dt_from_string) >+ $self->started_on(dt_from_string) > ->progress($job_progress) > ->status('started') > ->store; >@@ -98,14 +90,14 @@ sub process { > $report->{total_success} = scalar @record_ids; > } > >- my $job_data = decode_json $job->data; >+ my $job_data = decode_json $self->data; > $job_data->{messages} = \@messages; > $job_data->{report} = $report; > >- $job->ended_on(dt_from_string) >+ $self->ended_on(dt_from_string) > ->data(encode_json $job_data); >- $job->status('finished') if $job->status ne 'cancelled'; >- $job->store; >+ $self->status('finished') if $self->status ne 'cancelled'; >+ $self->store; > } > > =head3 enqueue >-- >2.34.1
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 27344
:
114877
|
116252
|
116931
|
132444
|
132445
|
132446
|
132586
|
132609
|
132610
|
132611
|
132612
|
132613
|
132645
|
132646
|
132794
|
132795
|
132796
|
132797
|
132798
|
132843
|
132844
|
132845
|
132969
|
132970
|
132994
|
132995
|
133033
|
134406
|
134407
| 134408 |
134409
|
134410
|
134411
|
134412
|
134413