You are here

function simple_oauth_cron in Simple OAuth (OAuth2) & OpenID Connect 8.2

Same name and namespace in other branches
  1. 8.4 simple_oauth.module \simple_oauth_cron()
  2. 8 simple_oauth.module \simple_oauth_cron()
  3. 8.3 simple_oauth.module \simple_oauth_cron()
  4. 5.x simple_oauth.module \simple_oauth_cron()

Implements hook_cron().

File

./simple_oauth.module, line 15
Contains simple_oauth.module..

Code

function simple_oauth_cron() {

  /** @var \Drupal\simple_oauth\ExpiredCollector $collector */
  $collector = \Drupal::service('simple_oauth.expired_collector');

  // Collect all expired tokens and delete them.
  $collector
    ->deleteMultipleTokens($collector
    ->collect());
}