diff options
author | matthew <matthew> | 2007-03-08 11:37:42 +0000 |
---|---|---|
committer | matthew <matthew> | 2007-03-08 11:37:42 +0000 |
commit | 050d1f883c238b6ec5421afbe83d65da39cd7e30 (patch) | |
tree | d51a3280b3e1e6c8e908ba7fd4c45753180092a8 | |
parent | c2f535d9c3bd44cb3c0487d05806dbdf21eba06a (diff) |
Slightly better cron report
-rwxr-xr-x | bin/send-reports | 13 | ||||
-rw-r--r-- | conf/crontab.ugly | 4 |
2 files changed, 9 insertions, 8 deletions
diff --git a/bin/send-reports b/bin/send-reports index 6461111ee..688d9f08e 100755 --- a/bin/send-reports +++ b/bin/send-reports @@ -6,7 +6,7 @@ # Copyright (c) 2007 UK Citizens Online Democracy. All rights reserved. # Email: matthew@mysociety.org. WWW: http://www.mysociety.org # -# $Id: send-reports,v 1.15 2007-03-05 16:40:12 matthew Exp $ +# $Id: send-reports,v 1.16 2007-03-08 11:37:42 matthew Exp $ use strict; require 5.8.0; @@ -46,14 +46,15 @@ foreach my $row (@$unsent) { # XXX Needs locks! my @councils = split ',', $row->{council}; my $areas_info = mySociety::MaPit::get_voting_areas_info(\@councils); - my (@to, %recips); - my $all_confirmed = 1; + my (@to, %recips, @notgot); foreach my $council (@councils) { my $name = $areas_info->{$council}->{name}; my ($council_email,$confirmed) = dbh()->selectrow_array( 'SELECT email,confirmed FROM contacts WHERE area_id=?', {}, $council); next unless $council_email; # Ignore missing councils - $all_confirmed = 0 unless $confirmed; + unless ($confirmed) { + push @notgot, $council_email; + } push @to, [ $council_email, $name ]; $recips{$council_email} = 1; } @@ -63,8 +64,8 @@ foreach my $row (@$unsent) { print " ...but we have no contact details for any of them!\n"; next; } - if (!$all_confirmed) { - print " ...but one or more email addresses have not been confirmed\n"; + if (@notgot) { + print " ...but these addresses have not been confirmed: " . join(',',@notgot) . "\n"; next; } diff --git a/conf/crontab.ugly b/conf/crontab.ugly index 8168f08a4..b70cd5e36 100644 --- a/conf/crontab.ugly +++ b/conf/crontab.ugly @@ -4,7 +4,7 @@ # Copyright (c) 2007 UK Citizens Online Democracy. All rights reserved. # Email: matthew@mysociety.org. WWW: http://www.mysociety.org/ # -# $Id: crontab.ugly,v 1.3 2007-02-08 18:36:02 matthew Exp $ +# $Id: crontab.ugly,v 1.4 2007-03-08 11:37:42 matthew Exp $ PATH=/usr/local/bin:/usr/bin:/bin !!(* if ($vhost eq "matthew.bci.mysociety.org") { *)!! @@ -13,6 +13,6 @@ MAILTO=matthew@mysociety.org MAILTO=team@neighbourhoodfixit.com !!(* } *)!! -30 * * * * !!(*= $user *)!! run-with-lockfile -n /data/vhost/!!(*= $vhost *)!!/send-reports.lock /data/vhost/!!(*= $vhost *)!!/mysociety/bci/bin/send-reports || echo "stalled?" +30 6-23 * * * !!(*= $user *)!! run-with-lockfile -n /data/vhost/!!(*= $vhost *)!!/send-reports.lock /data/vhost/!!(*= $vhost *)!!/mysociety/bci/bin/send-reports || echo "stalled?" 2 * * * * !!(*= $user *)!! run-with-lockfile -n /data/vhost/!!(*= $vhost *)!!/send-alerts.lock /data/vhost/!!(*= $vhost *)!!/mysociety/bci/bin/send-alerts || echo "stalled?" |