diff --git a/Koha/BackgroundJob/PseudonymizeStatistic.pm b/Koha/BackgroundJob/PseudonymizeStatistic.pm index 9ab9c18727..963f68287e 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 9e430df3f2..fa01405913 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; };