Bugzilla – Attachment 134419 Details for
Bug 30360
Add helper methods to Koha::BackgroundJobs
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 30360: Make UpdateElasticIndex use the helper methods
Bug-30360-Make-UpdateElasticIndex-use-the-helper-m.patch (text/plain), 1.97 KB, created by
David Nind
on 2022-04-29 18:06:10 UTC
(
hide
)
Description:
Bug 30360: Make UpdateElasticIndex use the helper methods
Filename:
MIME Type:
Creator:
David Nind
Created:
2022-04-29 18:06:10 UTC
Size:
1.97 KB
patch
obsolete
>From 000f06487817ab78f398977c2bc50bf54d1629f5 Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Tue, 5 Apr 2022 10:53:12 +0200 >Subject: [PATCH] Bug 30360: Make UpdateElasticIndex use the helper methods > >Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> > >Signed-off-by: David Nind <david@davidnind.com> >--- > Koha/BackgroundJob/UpdateElasticIndex.pm | 23 +++++------------------ > 1 file changed, 5 insertions(+), 18 deletions(-) > >diff --git a/Koha/BackgroundJob/UpdateElasticIndex.pm b/Koha/BackgroundJob/UpdateElasticIndex.pm >index 3387b0cfc7..c2bd48aa1f 100644 >--- a/Koha/BackgroundJob/UpdateElasticIndex.pm >+++ b/Koha/BackgroundJob/UpdateElasticIndex.pm >@@ -17,9 +17,6 @@ package Koha::BackgroundJob::UpdateElasticIndex; > > use Modern::Perl; > >-use JSON qw( encode_json decode_json ); >- >-use Koha::DateUtils qw( dt_from_string ); > use Koha::SearchEngine; > use Koha::SearchEngine::Indexer; > >@@ -54,14 +51,7 @@ Process the modification. > sub process { > my ( $self, $args ) = @_; > >- # 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; >- $self->started_on(dt_from_string) >- ->progress($job_progress) >- ->status('started') >- ->store; >+ $self->start; > > my @record_ids = @{ $args->{record_ids} }; > my $record_server = $args->{record_server}; >@@ -93,14 +83,11 @@ sub process { > $report->{total_success} = scalar @record_ids; > } > >- my $job_data = decode_json $self->data; >- $job_data->{messages} = \@messages; >- $job_data->{report} = $report; >+ my $data = $self->decoded_data; >+ $data->{messages} = \@messages; >+ $data->{report} = $report; > >- $self->ended_on(dt_from_string) >- ->data(encode_json $job_data); >- $self->status('finished') if $self->status ne 'cancelled'; >- $self->store; >+ $self->finish( $data ); > } > > =head3 enqueue >-- >2.30.2
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 30360
:
132247
|
132952
|
132953
|
134414
|
134415
|
134416
|
134417
|
134418
|
134419
|
134631
|
134632
|
134633