function comment_cron

Same name and namespace in other branches
  1. 8.9.x core/modules/comment/comment.module \comment_cron()
  2. 10 core/modules/comment/comment.module \comment_cron()
  3. 11.x core/modules/comment/comment.module \comment_cron()

Implements hook_cron().

File

core/modules/comment/comment.module, line 408

Code

function comment_cron() {
    // Store the maximum possible comments per thread (used for node search
    // ranking by reply count).
    \Drupal::state()->set('comment.node_comment_statistics_scale', 1.0 / max(1, \Drupal::service('comment.statistics')->getMaximumCount('node')));
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.