function oauth_common_cron in OAuth 1.0 7.3
Same name and namespace in other branches
- 6.3 oauth_common.module \oauth_common_cron()
- 7.4 oauth_common.module \oauth_common_cron()
Implements hook_cron().
File
- ./
oauth_common.module, line 178
Code
function oauth_common_cron() {
$token_condition = db_and()
->condition('expires', 0, '<>')
->condition('expires', REQUEST_TIME, '<=');
db_delete('oauth_common_provider_token')
->condition('tid', db_select('oauth_common_token', 't')
->condition($token_condition)
->fields('t', array(
'tid',
)), 'IN')
->execute();
db_delete('oauth_common_token')
->condition($token_condition)
->execute();
// Should 300 be overriden in DrupalOAuthServer and made configurable?
db_delete('oauth_common_nonce')
->condition('timestamp', REQUEST_TIME - 300, '<')
->execute();
}