You are here

function message_cron in Message 8

Same name and namespace in other branches
  1. 7 message.module \message_cron()

Implements hook_cron().

Fetch all message templates and purge old messages.

File

./message.module, line 117
API functions to manipulate messages.

Code

function message_cron() {

  /** @var \Drupal\message\MessagePurgeOrchestrator $purge_orchestrator */
  $purge_orchestrator = \Drupal::service('message.purge_orchestrator');
  $purge_orchestrator
    ->purgeAllTemplateMessages();
}