Skip to content

Commit

Permalink
Don't delay if we ask for specific constituencies.
Browse files Browse the repository at this point in the history
  • Loading branch information
davorg committed Jan 20, 2015
1 parent f766ecb commit 5f700c1
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion bin/create_lists
Expand Up @@ -15,9 +15,12 @@ my $sch = TwittElection::Schema->get_schema;

my $con_rs;

my $delay = 1;

if (@ARGV) {
$con_rs = $sch->resultset('Constituency')->search({
mapit_id => \@ARGV,
$delay = 0;
});
} else {
$con_rs = $sch->resultset('Constituency');
Expand Down Expand Up @@ -75,7 +78,7 @@ foreach my $con ($con_rs->all) {
next;
}

if ($con->list_rebuilt_time > DateTime->now->subtract(days=>1)) {
if ($delay and $con->list_rebuilt_time > DateTime->now->subtract(days=>1)) {
warn "List rebuilt too recently\n";
next;
}
Expand Down

0 comments on commit 5f700c1

Please sign in to comment.