Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Is it possible to update the stats without having to wait for a cron run?
Comments
Comment #1
toemaz CreditAttribution: toemaz commentedThe stats updating happens in the user_visits_adv_cron() function so the immediate answer is no.
A solution would be move the code to a new function and add a check in the cron function whether it is enabled or not via a variable_get check.
Feel free to code that up and provide a patch. Also, can you perhaps share your use case?
Comment #2
adam_c CreditAttribution: adam_c commentedI am by no means a drupal programmer so that would be beyond my skill right now, I may be able to get a friend to do it at some point in the future.
My case is a social networking site, I would just like the site to work in real time and keep up-to-date as opposed to having to wait for periodic cron runs, it's nothing major, just a preference.
Comment #3
amitgoyal CreditAttribution: amitgoyal commentedIf you don't want to setup CRON then Poormanscron module can be used which runs the Drupal cron operation using normal browser/page requests instead of having to set up a crontab to request the cron.php script.