Skip to content

Commit

Permalink
Allow to disable cache gc. By using a falsey value for probability
Browse files Browse the repository at this point in the history
you can disable cache gc calls.
  • Loading branch information
Clément Hallet authored and markstory committed Mar 8, 2011
1 parent 7853189 commit e2b37d8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cake/libs/cache.php
Expand Up @@ -149,7 +149,7 @@ function _buildEngine($name) {
$cacheClass = $class . 'Engine';
$this->_engines[$name] =& new $cacheClass();
if ($this->_engines[$name]->init($config)) {
if (time() % $this->_engines[$name]->settings['probability'] === 0) {
if ($this->_engines[$name]->settings['probability'] && time() % $this->_engines[$name]->settings['probability'] === 0) {
$this->_engines[$name]->gc();
}
return true;
Expand Down

0 comments on commit e2b37d8

Please sign in to comment.