From: minima Date: Fri, 27 Oct 2000 22:01:07 +0000 (+0000) Subject: alter the hourly cleanup code in DXMsg to see whether that works better. X-Git-Tag: R_1_45~81 X-Git-Url: http://dxcluster.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=b736286d16b3c0e310df106f727ca2143a000e08;p=spider.git alter the hourly cleanup code in DXMsg to see whether that works better. --- diff --git a/perl/DXMsg.pm b/perl/DXMsg.pm index 55834fc3..2de6a22a 100644 --- a/perl/DXMsg.pm +++ b/perl/DXMsg.pm @@ -458,7 +458,7 @@ sub del_msg my $self = shift; # remove it from the active message list - @msg = map { $_ != $self ? $_ : () } @msg; + @msg = grep { $ref($_) && $_ != $self } @msg; # belt and braces (one day I will ask someone if this is REALLY necessary) delete $self->{gotit}; @@ -476,7 +476,7 @@ sub clean_old # mark old messages for deletion foreach $ref (@msg) { - if (!$ref->{keep} && $ref->{t} < $main::systime - $maxage) { + if (ref($ref) && !$ref->{keep} && $ref->{t} < $main::systime - $maxage) { $ref->{deleteme} = 1; delete $ref->{gotit}; delete $ref->{list}; @@ -486,7 +486,7 @@ sub clean_old } # remove them all from the active message list - @msg = map { $_->{deleteme} ? () : $_ } @msg; + @msg = grep { ref($_) && !$_->{deleteme} } @msg; $last_clean = $main::systime; }