We have two lines for cleanup_database in cron. koha-foreach --enabled /usr/share/koha/bin/cronjobs/cleanup_database.pl --sessions --zebraqueue 10 --list-invites koha-foreach --enabled --noemail /usr/share/koha/bin/cronjobs/cleanup_database.pl --mail The second line contains an noemail parameter that seems to be unused. What is it doing there ?
Hm noemail is picked up by koha-list So it says something like: if you did not enable email, call cleanup with mail option. Some kind of contradiction in itself huh?
Created attachment 54831 [details] [review] Bug 17159: Do not conditionally run cleanup_database with --mail As a simplification, I propose here to just call cleanup_database in only one line. And not test the mail enabled/disabled flag for the --mail option. If we have no lines to delete, that's just fine and we can go home early :)
Created attachment 54832 [details] [review] Bug 17159: Add --mail to the cron example file too It was not even there yet. Test plan: Verify if this change looks good.
Hmm I am not sure this a safe change. The first run cleans up the sessions, and zebraqueue for all enabled instances. The second run deletes rows from the mailqueue for instances that don't have email enabled. We don't want to delete them from the ones that do send email, because then we dont have a record of what notices were sent to people. This will now delete them
(In reply to Chris Cormack from comment #4) > Hmm I am not sure this a safe change. > > The first run cleans up the sessions, and zebraqueue for all enabled > instances. > The second run deletes rows from the mailqueue for instances that don't have > email enabled. > > We don't want to delete them from the ones that do send email, because then > we dont have a record of what notices were sent to people. > > This will now delete them That is the purpose of the job. After a specified number of days (say 30) we are not interested in keeping all those records. And after all, having a record that some notice was produced does not 'prove' that the client actually received it.
No, this cron is set up the way it is by design. /cgi-bin/koha/members/notices.pl shows you the notices sent to borrowers. If you change this cron job, I will tell all the librarians who start complaining to me to call you :-)