Same name and namespace in other branches
- 4.6.x modules/statistics.module \statistics_cron()
- 4.7.x modules/statistics.module \statistics_cron()
- 5.x modules/statistics/statistics.module \statistics_cron()
- 6.x modules/statistics/statistics.module \statistics_cron()
- 7.x modules/statistics/statistics.module \statistics_cron()
- 8.9.x core/modules/statistics/statistics.module \statistics_cron()
- 9 core/modules/statistics/statistics.module \statistics_cron()
Implements hook_cron().
File
- core/
modules/ statistics/ statistics.module, line 74 - Logs and displays content statistics for a site.
Code
function statistics_cron() {
$storage = \Drupal::service('statistics.storage.node');
$storage
->resetDayCount();
$max_total_count = $storage
->maxTotalCount();
\Drupal::state()
->set('statistics.node_counter_scale', 1.0 / max(1.0, $max_total_count));
}