You are here

function oauth_common_cron in OAuth 1.0 6.3

Same name and namespace in other branches
  1. 7.4 oauth_common.module \oauth_common_cron()
  2. 7.3 oauth_common.module \oauth_common_cron()

Implementation of hook_cron().

File

./oauth_common.module, line 174

Code

function oauth_common_cron() {
  $now = time();
  db_query("DELETE FROM {oauth_common_provider_token} WHERE tid IN\n    (SELECT tid FROM {oauth_common_token}\n    WHERE expires != 0 AND expires <= %d)", $now);
  db_query("DELETE FROM {oauth_common_token}\n    WHERE expires != 0 AND expires <= %d", $now);
  db_query("DELETE FROM {oauth_common_nonce}\n    WHERE timestamp < %d", $now - 300);
}