function visitors_cron in Visitors 8.2
Same name and namespace in other branches
- 8 visitors.module \visitors_cron()
- 7.2 visitors.module \visitors_cron()
- 7 visitors.module \visitors_cron()
- 7.0 visitors.module \visitors_cron()
Implements of hook_cron().
File
- ./
visitors.module, line 44 - Logs visitors for your site.
Code
function visitors_cron() {
$flush_log_timer = \Drupal::config('visitors.config')
->get('flush_log_timer', 0);
if ($flush_log_timer > 0) {
// Clean up expired access logs.
\Drupal::database()
->delete('visitors')
->condition('visitors_date_time', time() - $flush_log_timer, '<')
->execute();
}
}