You are here

function advagg_cleanup_semaphore_table in Advanced CSS/JS Aggregation 7.2

Delete orphaned/expired advagg locks from the semaphore database table.

Return value

int Count of the number of rows removed from the databases.

2 calls to advagg_cleanup_semaphore_table()
advagg_admin_cleanup_semaphore_table_button in ./advagg.admin.inc
Delete orphaned/expired advagg locks from the semaphore database table.
advagg_cron in ./advagg.module
Implements hook_cron().

File

./advagg.cache.inc, line 685
Advanced CSS/JS aggregation module.

Code

function advagg_cleanup_semaphore_table() {

  // Let expiration times vary by 5 minutes.
  $fuzz_factor = 300;
  $results = db_delete('semaphore')
    ->condition('name', db_like('advagg_') . '%', 'LIKE')
    ->condition('expire', REQUEST_TIME - $fuzz_factor, '<')
    ->execute();
  return $results;
}