);
}
=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
my @bib_records;
my @auth_records;
my $jobs = Koha::BackgroundJobs->search( { id => [ map { $_->id } @jobs ] });
# Start
$jobs->update({
progress => 0,
status => 'started',
started_on => \'NOW()',
});
for my $job (@jobs) {
my $args = try {
$job->json->decode( $job->data );
};
Koha::BackgroundJobs->search( { id => [ map { $_->id } @jobs ] })->finish();
# Finish
progress => 1,
ended_on => \'NOW()',
-