Changeset 380

Show
Ignore:
Timestamp:
08/25/06 02:11:52 (2 years ago)
Author:
marksmith
Message:

* only try testing write capability every 15 seconds

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/server-newrepl/lib/MogileFS/Worker/Monitor.pm

    r374 r380  
    2424    my $update_db_every = 15; 
    2525    my %last_db_update;  # devid -> time.  update db less often than poll interval. 
     26    my %last_test_write; # devid -> time.  time we last tried writing to a device. 
    2627 
    2728    every(2.5, sub { 
     
    101102            } 
    102103 
     104            # next if we're not going to try this now 
     105            next if $last_test_write{$dev->{devid}} + $update_db_every > $now; 
     106            $last_test_write{$dev->{devid}} = $now; 
     107 
    103108            # now we want to check if this device is writeable 
    104109            my $num = int(rand 10000);  # this was "$$-$now" before, but we don't yet have a cleaner in mogstored for these files