User:AnomieBOT/source/tasks/WikiProjectWorker.pm: Difference between revisions

Content deleted Content added
AnomieBOT (talk | contribs)
Updating published sources: WikiProjectWorker: * Add a log message for when the bot thinks it's done, so I can easily check the log to determine that.
AnomieBOT (talk | contribs)
Updating published sources: WikiProjectWorker: * Don't reset the iterator every 5 minutes.
Line 100:
my $self=$class->SUPER::new();
$self->{'config loaded'}=0;
$self->{'iter'}=undef;
$self->{'iterators'}=[@iterators];
bless $self, $class;
return $self;
Line 147 ⟶ 149:
my $endtime=time()+300;
 
while(1){
foreach my $itercfg (@iterators) {
my $iter=$apiself->iterator(%$itercfg){'iter'};
if(!defined($iter)){
my $i=shift @{$self->{'iterators'}};
last unless $i;
$iter=$api->iterator(%$i);
$self->{'iter'}=$iter;
}
while(my $page=$iter->next()){
if(!$page->{'_ok_'}){
Line 393 ⟶ 401:
return 0 if time()>=$endtime;
}
$self->{'iter'}=undef;
}
 
# No more pages to check, try again in 10 minutes or so in case of errors.
$self->{'iter'}=undef;
$self->{'iterators'}=[@iterators];
$api->log("WikiProjectWorker may be DONE!");
return 600;