Show
Ignore:
Timestamp:
04/01/2008 05:08:13 AM (8 months ago)
Author:
Geert
Message:

Fixed another small cache bug. The requests config reads as follows: there is 1 out of {requests} chances that garbage collection will be triggered. However, setting requests to 1 would only give you 1 out of 2 chances. Not anymore.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/system/libraries/Cache.php

    r2377 r2394  
    8282                if (self::$loaded !== TRUE) 
    8383                { 
    84                         if (mt_rand(0, (int) $this->config['requests']) === 1) 
     84                        $this->config['requests'] = (int) $this->config['requests']; 
     85 
     86                        if ($this->config['requests'] > 0 AND mt_rand(1, $this->config['requests']) === 1) 
    8587                        { 
    8688                                // Do garbage collection