Changeset 106 for trunk/klask


Ignore:
Timestamp:
Dec 12, 2011, 2:41:00 PM (12 years ago)
Author:
g7moreau
Message:
  • Clean ref to float more than 3 mont old in certain case...
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/klask

    r105 r106  
    843843
    844844   my $timestamp_barrier = 3600 * 24 * $days_to_clean;
     845   my $timestamp_3month  = 3600 * 24 * 90;
    845846
    846847   my %mactimedb = ();
     
    878879            }
    879880
    880          if ( $ip_timestamp - $mactimedb{$ip_mac}->{timestamp} > $timestamp_barrier
     881         elsif ( $ip_timestamp - $mactimedb{$ip_mac}->{timestamp} > $timestamp_barrier
    881882            and (
    882883               not $ip_hostname_fq =~ m/^float/
    883884               or $mactimedb{$ip_mac}->{hostname_fq} =~ m/^float/
     885               )) {
     886            print "remove ip ".$mactimedb{$ip_mac}->{ip}."\n" if $verbose;
     887            delete $computerdb->{$mactimedb{$ip_mac}->{ip}};
     888            $database_has_changed++;
     889            }
     890
     891         elsif ( $mactimedb{$ip_mac}->{timestamp} > $ip_timestamp
     892            and $timestamp - $mactimedb{$ip_mac}->{timestamp} > $timestamp_3month
     893            and not $mactimedb{$ip_mac}->{hostname_fq} =~ m/^float/
     894               )) {
     895            print "remove ip $ip\n" if $verbose;
     896            delete $computerdb->{$ip};
     897            $database_has_changed++;
     898            }
     899
     900         elsif (  $ip_timestamp > $mactimedb{$ip_mac}->{timestamp}
     901            and $timestamp - $ip_timestamp > $timestamp_3month
     902            and not $ip_hostname_fq =~ m/^float/
    884903               )) {
    885904            print "remove ip ".$mactimedb{$ip_mac}->{ip}."\n" if $verbose;
Note: See TracChangeset for help on using the changeset viewer.