[Koha-bugs] [Bug 31969] Options for cleanup_database.pl to remove finished jobs from the background job queue

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Mon Nov 21 13:32:05 CET 2022


https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31969

--- Comment #18 from Jonathan Druart <jonathan.druart+koha at gmail.com> ---
Since when are we sending a confirm flag to a method? Why isn't this simply
reusing the same pattern that exist for other flags?

381 if ($pMessages) {
382     print "Purging messages older than $pMessages days.\n" if $verbose;
383     my $messages = Koha::Patron::Messages->filter_by_last_update(
384         { timestamp_column_name => 'message_date', days => $pMessages } );
385     my $count = $messages->count;
386     $messages->delete if $confirm;
387     if ( $verbose ) {
388         say $confirm
389           ? sprintf( "Done with purging %d messages", $count )
390           : sprintf( "%d messages would have been removed", $count );
391     }
392 }

That's all what you needed. No additional methods, unit tests, etc.

-- 
You are receiving this mail because:
You are watching all bug changes.


More information about the Koha-bugs mailing list