projects
/
spider.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
17b1614
)
fix mojo complaints in check_cache
author
Dirk Koopman
<djk@tobit.co.uk>
Wed, 29 Jul 2020 23:38:16 +0000
(
00:38
+0100)
committer
Dirk Koopman
<djk@tobit.co.uk>
Wed, 29 Jul 2020 23:38:16 +0000
(
00:38
+0100)
perl/DXUtil.pm
patch
|
blob
|
history
perl/RBN.pm
patch
|
blob
|
history
diff --git
a/perl/DXUtil.pm
b/perl/DXUtil.pm
index f7e52c9a92cb727e8c5431c4f9cd4d2d63e3d5e7..24fa840ff12962d50273bf7fbf3f99c3fc99cdd8 100644
(file)
--- a/
perl/DXUtil.pm
+++ b/
perl/DXUtil.pm
@@
-539,7
+539,7
@@
sub difft
if (ref $b eq 'ARRAY') {
$t = $b->[1] - $b->[0];
} else {
if (ref $b eq 'ARRAY') {
$t = $b->[1] - $b->[0];
} else {
- if ($adds >= $b) {
+ if ($adds
&& $adds
>= $b) {
$t = $adds - $b;
$adds = shift;
} else {
$t = $adds - $b;
$adds = shift;
} else {
diff --git
a/perl/RBN.pm
b/perl/RBN.pm
index d9fbe053f5d20960d6eb2c3397e2b1e5af059126..9ff7dd48b9399c14fabda88659e88840c442ebd6 100644
(file)
--- a/
perl/RBN.pm
+++ b/
perl/RBN.pm
@@
-623,6
+623,9
@@
sub per_10_minute
my $count = 0;
my $removed = 0;
while (my ($k,$cand) = each %{$spots}) {
my $count = 0;
my $removed = 0;
while (my ($k,$cand) = each %{$spots}) {
+ next if $k eq 'VERSION';
+ next if $k =~ /^O\|/;
+
if ($main::systime - $cand->[CTime] > $minspottime*2) {
delete $spots->{$k};
++$removed;
if ($main::systime - $cand->[CTime] > $minspottime*2) {
delete $spots->{$k};
++$removed;
@@
-668,7
+671,7
@@
sub check_cache
if (-e $cachefn) {
my $mt = (stat($cachefn))[9];
my $t = $main::systime - $mt || 1;
if (-e $cachefn) {
my $mt = (stat($cachefn))[9];
my $t = $main::systime - $mt || 1;
- my $p = difft($mt);
+ my $p = difft($mt
, 2
);
if ($t < $cache_valid) {
dbg("RBN:check_cache '$cachefn' spot cache exists, created $p ago and not too old");
my $fh = IO::File->new($cachefn);
if ($t < $cache_valid) {
dbg("RBN:check_cache '$cachefn' spot cache exists, created $p ago and not too old");
my $fh = IO::File->new($cachefn);
@@
-688,7
+691,8
@@
sub check_cache
if (exists $spots->{VERSION} && $spots->{VERSION} == $DATA_VERSION) {
# now clean out anything that is current
while (my ($k, $cand) = each %$spots) {
if (exists $spots->{VERSION} && $spots->{VERSION} == $DATA_VERSION) {
# now clean out anything that is current
while (my ($k, $cand) = each %$spots) {
- next unless ref $cand;
+ next if $k eq 'VERSION';
+ next if $k =~ /^O\|/;
if (@$cand > CData) {
$spots->{$k} = [$cand->[CTime], $cand->[CQual]];
}
if (@$cand > CData) {
$spots->{$k} = [$cand->[CTime], $cand->[CQual]];
}