my $delete = 0;
my $oldest = time();
foreach $chan (keys %::news) {
+ &DEBUG("sched: chan => $chan");
+
foreach $item (keys %{ $::news{$chan} }) {
my $t = $::news{$chan}{$item}{Expire};
+ &DEBUG("sched; item => $item");
my $tadd = $::news{$chan}{$item}{Time};
$oldest = $tadd if ($oldest > $tadd);
+ &DEBUG("sched: t => $t");
+
next if ($t == 0 or $t == -1);
if ($t < 1000) {
&status("newsFlush: Fixed Expire time for $chan/$item, should not happen anyway.");
next;
}
+ my $delta = $t - time();
+ &DEBUG("news: delta: $delta");
+
next unless (time() > $t);
+
# todo: show how old it was.
delete $::news{$chan}{$item};
&VERB("NEWS: deleted '$item'", 2);
}
}
+ if ($delete) {
+ &DEBUG("sched: Writing news....");
+ &News::writeNews();
+ }
+
# todo: flush users aswell.
my $duser = 0;
foreach $chan (keys %::newsuser) {
delete $sched{"chanlimitCheck"}{RUNNING};
}
+ if (scalar keys %netsplitservers) {
+ &WARN("clC: netsplit active (2); skipping. (netsplit => $netsplit)");
+ return;
+ }
+
foreach $chan ( &ChanConfList("chanlimitcheck") ) {
next unless (&validChan($chan));
### run NAMES again and flush it.
}
- next unless (!defined $limit or $limit != $newlimit);
+ next unless (!defined $limit);
+ if (defined $limit and $limit == $newlimit) {
+ $cache{chanlimitChange}{$chan} = time();
+ next;
+ }
if (!exists $channels{$chan}{'o'}{$ident}) {
&status("ChanLimit: dont have ops on $chan.") unless (exists $cache{warn}{chanlimit}{$chan});
&status("Flushed $flushed seen entries.") if ($flushed);
&VERB(sprintf(" new seen: %03.01f%% (%d/%d)",
$stats{'new'}*100/($stats{'count_old'} || 1),
- $stats{'new'}, $stats{'count_old'} ), 2) if ($stats{'new'});
+ $stats{'new'}, ( $stats{'count_old'} || 1) ), 2) if ($stats{'new'});
&VERB(sprintf(" now seen: %3.1f%% (%d/%d)",
- $stats{'old'}*100/&countKeys("seen"),
+ $stats{'old'}*100 / ( &countKeys("seen") || 1),
$stats{'old'}, &countKeys("seen") ), 2) if ($stats{'old'});
&WARN("scalar keys seenflush != 0!") if (scalar keys %seenflush);
delete $sched{"leakCheck"}{RUNNING};
}
- # flood.
+ # flood. this is dealt with in floodLoop()
foreach $blah1 (keys %flood) {
foreach $blah2 (keys %{ $flood{$blah1} }) {
$count += scalar(keys %{ $flood{$blah1}{$blah2} });
$count += scalar(keys %{ $floodjoin{$blah1}{$blah2} });
}
}
- &DEBUG("leak: hash flood has $count total keys.",2);
+ &DEBUG("leak: hash floodjoin has $count total keys.",2);
# floodwarn.
$count = scalar(keys %floodwarn);
}
}
+ # chanstats
+ $count = scalar(keys %chanstats);
+ &DEBUG("leak: hash chanstats has $count total keys.",2);
+
+ # nuh.
my $delete = 0;
foreach (keys %nuh) {
next if (&IsNickInAnyChan($_));
}
my @x = &getJoinChans();
- my $iconf = scalar( @x );
- my $inow = scalar( keys %channels );
+ my $iconf = scalar( @x );
+ my $inow = scalar( keys %channels );
if ($iconf > 2 and $inow * 2 <= $iconf) {
&FIXME("ircCheck: current channels * 2 <= config channels. FIXME.");
@joinchan = @x;
### this is semi-scheduled
sub getNickInUse {
+ &DEBUG("gNIU: ident => $ident, ircNick => $param{'ircNick'}");
if ($ident eq $param{'ircNick'}) {
&status("okay, got my nick back.");
return;
}
return unless ($backup);
+ my $age = &Time2String(time() - (stat $file)[9]);
+
### TODO: do internal copying.
- &status("Backup: $file to $file~");
+ &status("Backup: $file ($age)");
CORE::system("/bin/cp $file $file~");
}