function ad_cache_memcache_sync in Advertisement 5
Same name and namespace in other branches
- 5.2 cache/memcache/ad_cache_memcache.module \ad_cache_memcache_sync()
- 6 cache/memcache/ad_cache_memcache.module \ad_cache_memcache_sync()
Load advertisements into memory.
2 calls to ad_cache_memcache_sync()
- ad_cache_memcache_adcacheapi in cache/
memcache/ ad_cache_memcache.module - Ad module's adcacheapi _hook().
- ad_cache_memcache_cron in cache/
memcache/ ad_cache_memcache.module - Regularily syncronize counters into RAM.
2 string references to 'ad_cache_memcache_sync'
- ad_cache_memcache_adcacheapi in cache/
memcache/ ad_cache_memcache.module - Ad module's adcacheapi _hook().
- ad_cache_memcache_cron in cache/
memcache/ ad_cache_memcache.module - Regularily syncronize counters into RAM.
File
- cache/
memcache/ ad_cache_memcache.module, line 138 - A plug in for the ad.module, integrating the ad module with memcache.
Code
function ad_cache_memcache_sync() {
variable_set('ad_memcache_timestamp', time());
if (($error = ad_cache_memcache_requirements()) === TRUE) {
$result = db_query("SELECT aid, adtype FROM {ads} WHERE adstatus = 'active'");
while ($ad = db_fetch_object($result)) {
ad_cache_memcache_sync_ad($ad->aid);
}
// Sync counters.
ad_cache_memcache_sync_ad(0);
}
else {
drupal_set_message(t('!module: Unable to syncronize cache: !error', array(
'!module' => 'ad_cache_memcache.module',
'!error' => $error,
)), 'error');
}
}