If you use CACHE_PERMANENT tables get cleaned-up just sometimes(new module installed etc.)

The caching system supports the time, so why not use it in the time-based plugin.

Comments

dawehner’s picture

StatusFileSize
new1.43 KB

So here is the 2.x version.

gerhard killesreiter’s picture

StatusFileSize
new1.24 KB

Elementary maths improvement.

gerhard killesreiter’s picture

StatusFileSize
new1.43 KB

and for v2. I actually tested this patch.

gerhard killesreiter’s picture

This patch should go into the next views release. g.d.o had a 40G table due to this bug.

merlinofchaos’s picture

Rather than having views_plugin_cache_time() have its own cache_set() function, I propose we add a new method: cache_expire()

The default would be:

  function cache_expire() { 
    return CACHE_PERMANENT;
  }

Then views_plugin_cache_time() can override this with this logic:

  function cache_expire() { 
    if ($lifespan = $this->options[$type . '_lifespan']) {
      return time() + $lifespan;
    }
    else {
      return CACHE_PERMANENT;
    }
  }
dawehner’s picture

StatusFileSize
new1.95 KB

Here is patch with the suggested changes.

merlinofchaos’s picture

Status: Needs review » Fixed

Committed to all branches.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.