You are here

function tmgmt_extension_suit_cron in TMGMT Extension Suite 8.2

Same name and namespace in other branches
  1. 8 tmgmt_extension_suit.module \tmgmt_extension_suit_cron()

Implements hook_cron().

5 calls to tmgmt_extension_suit_cron()
BaseTest::testThrottle12of15CronRuns in tests/src/Kernel/BaseTest.php
BaseTest::testThrottleCronRun in tests/src/Kernel/BaseTest.php
BaseTest::testThrottlingInterval3hLastRun1hAgo in tests/src/Kernel/BaseTest.php
BaseTest::testThrottlingInterval3hLastRun3hAgo in tests/src/Kernel/BaseTest.php
BaseTest::testThrottlingInterval3hLastRun4hAgo in tests/src/Kernel/BaseTest.php

File

./tmgmt_extension_suit.module, line 92

Code

function tmgmt_extension_suit_cron() {
  $key = 'tmgmt_extension_suit.check_status_cron_last';
  $check_status_cron_last = \Drupal::state()
    ->get($key, 0);
  $request_time = time();
  if (tmgmt_extension_suit_is_add_to_check_status_cron_run_needed($check_status_cron_last, $request_time)) {
    tmgmt_extension_suit_add_to_check_status();
    \Drupal::state()
      ->set($key, $request_time);
  }
}