You are here

function ad_cache_memcache_cron in Advertisement 5

Same name and namespace in other branches
  1. 5.2 cache/memcache/ad_cache_memcache.module \ad_cache_memcache_cron()
  2. 6 cache/memcache/ad_cache_memcache.module \ad_cache_memcache_cron()

Regularily syncronize counters into RAM.

File

cache/memcache/ad_cache_memcache.module, line 121
A plug in for the ad.module, integrating the ad module with memcache.

Code

function ad_cache_memcache_cron() {
  $ad_memcache_timestamp = variable_get('ad_memcache_timestamp', '');
  if (time() - $ad_memcache_timestamp >= variable_get('ad_cache_memcache_sync', 600)) {
    ad_cache_memcache_sync();
  }
  $ad_memcache_build = variable_get('ad_memcache_build', '');

  // rebuild cache every 12 hours
  // TODO: Make configurable
  if (time() - $ad_memcache_build >= 43200) {
    ad_cache_memcache_build();
  }
}