Bugzilla – Attachment 148350 Details for
Bug 32594
Add a dedicated ES indexing background worker
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 32594: POC
Bug-32594-POC.patch (text/plain), 1.42 KB, created by
Nick Clemens (kidclamp)
on 2023-03-17 14:22:42 UTC
(
hide
)
Description:
Bug 32594: POC
Filename:
MIME Type:
Creator:
Nick Clemens (kidclamp)
Created:
2023-03-17 14:22:42 UTC
Size:
1.42 KB
patch
obsolete
>From 1985eac9a6e912b8fe3cf3efc9ee11f151071630 Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Fri, 17 Mar 2023 14:22:24 +0000 >Subject: [PATCH] Bug 32594: POC > >--- > Koha/BackgroundJobs.pm | 21 +++++++++++++++++++++ > misc/workers/es_indexer_daemon.pl | 2 +- > 2 files changed, 22 insertions(+), 1 deletion(-) > >diff --git a/Koha/BackgroundJobs.pm b/Koha/BackgroundJobs.pm >index 48afbf68fa..f3f6e39e77 100644 >--- a/Koha/BackgroundJobs.pm >+++ b/Koha/BackgroundJobs.pm >@@ -72,6 +72,27 @@ sub filter_by_current { > ); > } > >+=head3 finish >+ >+ my $jobs->finish; >+ >+Finishes multiple jobs, assumes you have handled success or failure. >+ >+=cut >+ >+sub finish { >+ my ($self) = @_; >+ >+ while( my $job = $self->next ){ >+ $job->update({ >+ progress => $job->size(), >+ status => 'finished', >+ ended_on =>\'NOW()' >+ },{ no_triggers => 1}); >+ } >+ >+} >+ > =head2 Internal methods > > =head3 _type >diff --git a/misc/workers/es_indexer_daemon.pl b/misc/workers/es_indexer_daemon.pl >index b871acefcf..4075bb6607 100755 >--- a/misc/workers/es_indexer_daemon.pl >+++ b/misc/workers/es_indexer_daemon.pl >@@ -182,5 +182,5 @@ sub commit { > }; > } > >- Koha::BackgroundJobs->search( { id => [ map { $_->id } @jobs ] } )->update( { status => 'finished', progress => 1 }, { no_triggers => 1 } ); >+ Koha::BackgroundJobs->search( { id => [ map { $_->id } @jobs ] })->finish(); > } >-- >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 32594
:
145145
|
145195
|
145196
|
145197
|
145704
|
145711
|
146402
|
146831
|
147141
|
147460
|
147562
|
148350
|
148513
|
148571
|
148588