[Koha-bugs] [Bug 24153] Add a confirm flag to the cleanup_database.pl cronjob

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Fri Jun 19 10:40:58 CEST 2020


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

Marcel de Rooy <m.de.rooy at rijksmuseum.nl> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|BLOCKED                     |Failed QA

--- Comment #10 from Marcel de Rooy <m.de.rooy at rijksmuseum.nl> ---
+# FIXME The output for dry-run mode needs to be improved
Yes. Agreed.

+    $tokens->delete if $confirm;
+    say sprintf "Removed %s expired OAuth2 tokens", $count if $verbose;
This might be confusing. Among other examples.

* perl misc/cronjobs/cleanup_database.pl -m 10 -v
Mail queue purge triggered for 10 days.
Use of uninitialized value $count in concatenation (.) or string at
misc/cronjobs/cleanup_database.pl line 293.
 messages were deleted from the mail queue.

So uninitialized warning that we do not want.
But this example could serve to illustrate that even the wrong count could have
been printed. Look at:
    if ( $confirm ) {
        $sth->execute($mail) or die $dbh->errstr;
        $count = $sth->rows;
    }
    print "$count messages were deleted from the mail queue.\nDone with
message_queue purge.\n" if $verbose;
=> Since the count is not set, it could well be the count of a former statement
!

I do not think that this is ready for production. Since we do not really
support testing for many options, I do not see why this patch is useful.

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


More information about the Koha-bugs mailing list