+
+ # periodic clearing out of the two caches
+ if ($tim % 60 == 0 && $last != $tim) {
+ my $count = 0;
+ my $removed = 0;
+
+ while (my ($k,$v) = each %d) {
+ if ($tim-$v > 60) {
+ delete $d{$k};
+ ++$removed
+ } else {
+ ++$count;
+ }
+ }
+ say "admin,rbn cache: $removed removed $count remain" if $dbg;
+ $count = $removed = 0;
+ while (my ($k,$v) = each %spot) {
+ if ($tim-$v > $minspottime*2) {
+ delete $spot{$k};
+ ++$removed;
+ } else {
+ ++$count;
+ }
+ }
+ say "admin,spot cache: $removed removed $count remain" if $dbg;
+
+ say join(',', "STAT", $noraw, $norbn, $nospot) if $showstats;
+ $noraw = $norbn = $nospot = 0;
+
+ $last = $tim;
+ }