Bugzilla – Attachment 189495 Details for
Bug 41238
Pseudonymize statistic jobs don't update progress
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 41238: Update progress for peseudonmyzation bacgkround jobs
Bug-41238-Update-progress-for-peseudonmyzation-bac.patch (text/plain), 2.32 KB, created by
Nick Clemens (kidclamp)
on 2025-11-11 18:53:23 UTC
(
hide
)
Description:
Bug 41238: Update progress for peseudonmyzation bacgkround jobs
Filename:
MIME Type:
Creator:
Nick Clemens (kidclamp)
Created:
2025-11-11 18:53:23 UTC
Size:
2.32 KB
patch
obsolete
>From c537bfccd72b4b72926d0479a4b50cc9ab2a6a96 Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Tue, 11 Nov 2025 18:52:04 +0000 >Subject: [PATCH] Bug 41238: Update progress for peseudonmyzation bacgkround > jobs > >To test: >Enable pseudonymization, may need to add bcrypt settings (see bug 28911) >Perform some circulations >View the jobs (Admin->Manage jobs) >Filter for Pseudonymize statistic >Note the progress is 0/1 even when job finished >Apply patch, restart all >Do more circulations >Confirm jobs now say 1/1 complete >--- > Koha/BackgroundJob/PseudonymizeStatistic.pm | 2 ++ > t/db_dependent/Koha/BackgroundJob/PseudonymizeStatistic.t | 5 +++-- > 2 files changed, 5 insertions(+), 2 deletions(-) > >diff --git a/Koha/BackgroundJob/PseudonymizeStatistic.pm b/Koha/BackgroundJob/PseudonymizeStatistic.pm >index 9ab9c187270..963f68287e1 100644 >--- a/Koha/BackgroundJob/PseudonymizeStatistic.pm >+++ b/Koha/BackgroundJob/PseudonymizeStatistic.pm >@@ -53,6 +53,8 @@ sub process { > my $statistic = $args->{statistic}; > my $stat_object = Koha::Statistic->new($statistic); > Koha::PseudonymizedTransaction->create_from_statistic($stat_object); >+ $self->progress(1) >+ ; #We could use step here, but we are going to save the object during finish and this saves a DB write > $self->finish( { data => "" } ); # We want to clear the job data to avoid storing patron information > > } >diff --git a/t/db_dependent/Koha/BackgroundJob/PseudonymizeStatistic.t b/t/db_dependent/Koha/BackgroundJob/PseudonymizeStatistic.t >index 9e430df3f2f..fa01405913e 100755 >--- a/t/db_dependent/Koha/BackgroundJob/PseudonymizeStatistic.t >+++ b/t/db_dependent/Koha/BackgroundJob/PseudonymizeStatistic.t >@@ -68,7 +68,7 @@ subtest 'enqueue() tests' => sub { > > subtest 'process() tests' => sub { > >- plan tests => 3; >+ plan tests => 4; > > $schema->storage->txn_begin; > >@@ -103,7 +103,8 @@ subtest 'process() tests' => sub { > is( $statistic->{datetime}, $pt_after->last->datetime, "'datetime' column preserved" ); > > $job->discard_changes; >- is( $job->data, '{"data":""}', "Job data cleared after pseudonymization" ); >+ is( $job->data, '{"data":""}', "Job data cleared after pseudonymization" ); >+ is( $job->progress, 1, "Job progress is updated" ); > > $schema->storage->txn_rollback; > }; >-- >2.39.5
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 41238
:
189495
|
189496