You are here

function boost_crawler_prune_table in Boost 6

Remove any urls in the crawler table if they are not expired or flushed.

Parameters

$expire: Has the site changed, if so get expire column

1 call to boost_crawler_prune_table()
boost_crawler_seed_tables in ./boost.module
Logic to get boost_crawler table ready.

File

./boost.module, line 6280
Provides static file caching for Drupal text output. Pages, Feeds, ect...

Code

function boost_crawler_prune_table($expire) {
  if (variable_get('boost_crawl_prune_table', FALSE)) {
    return TRUE;
  }
  if ($expire && BOOST_LOOPBACK_BYPASS) {
    db_query("DELETE FROM {boost_crawler} WHERE hash IN (SELECT ca.hash_url FROM {boost_cache} ca WHERE ca.expire BETWEEN 1 AND 434966399 OR ca.expire > %d)", BOOST_TIME);
  }
  else {
    db_query("DELETE FROM {boost_crawler} WHERE hash IN (SELECT ca.hash_url FROM {boost_cache} ca WHERE ca.expire BETWEEN 1 AND 434966399 OR ca.expire > 434966400)");
  }
  variable_set('boost_crawl_prune_table', TRUE);
  return FALSE;
}