Changeset 1341 for trunk

Show
Ignore:
Timestamp:
11/05/09 06:41:51 (3 weeks ago)
Author:
robbat2
Message:

Fixup handling statically cached stores from <victoriggy@…>.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/server/lib/MogileFS/Server.pm

    r1336 r1341  
    236236# they'll ask for the current store, which is a database abstraction 
    237237# layer. 
    238 my ($store, $store_pid); 
     238my (%stores); 
    239239sub get_store { 
    240     return $store if $store && $store_pid == $$; 
    241     $store_pid = $$; 
    242     return $store = MogileFS::Store->new; 
     240    return $stores{$$} if $stores{$$}; 
     241    return $stores{$$} = MogileFS::Store->new; 
    243242} 
    244243 
     
    246245sub set_store { 
    247246    my ($s) = @_; 
    248     $store = $s; 
    249     $store_pid = $$; 
     247    $stores{$$} = $s; 
    250248} 
    251249