Skip to content

Instantly share code, notes, and snippets.

@superbiche
Last active June 14, 2019 18:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save superbiche/4dc012f65fb38d4a369925229a29e374 to your computer and use it in GitHub Desktop.
Save superbiche/4dc012f65fb38d4a369925229a29e374 to your computer and use it in GitHub Desktop.
diff --git a/simple_oauth.module b/simple_oauth.module
index deba4e1..b4e7904 100644
--- a/simple_oauth.module
+++ b/simple_oauth.module
@@ -19,19 +19,20 @@ use Drupal\user\RoleInterface;
/**
* Implements hook_cron().
*/
+
function simple_oauth_cron() {
/** @var \Drupal\simple_oauth\ExpiredCollector $collector */
- $collector = \Drupal::service('simple_oauth.expired_collector');
- $config = \Drupal::config('simple_oauth.settings');
- $logger = \Drupal::logger('simple_oauth');
- $token_cron_batch_size = $config->get('token_cron_batch_size');
+ // $collector = \Drupal::service('simple_oauth.expired_collector');
+ // $config = \Drupal::config('simple_oauth.settings');
+ // $logger = \Drupal::logger('simple_oauth');
+ // $token_cron_batch_size = $config->get('token_cron_batch_size');
// Deleting one batch of expired tokens.
- if (!empty($expired_tokens = $collector->collect($token_cron_batch_size))) {
- $collector->deleteMultipleTokens($expired_tokens);
- $logger->notice('Deleted @limit expired tokens in cron.', [
- '@limit' => $token_cron_batch_size,
- ]);
- }
+ //if (!empty($expired_tokens = $collector->collect($token_cron_batch_size))) {
+ // $collector->deleteMultipleTokens($expired_tokens);
+ // $logger->notice('Deleted @limit expired tokens in cron.', [
+ // '@limit' => $token_cron_batch_size,
+ // ]);
+ //}
}
/**
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment