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.
I've been testing this module and it appears that the fields aren't being updated on cron run. I have Drupal's cron setting set to run every 1 hour. Would be great to get this fixed...or do I have to use my server cron function?
Comment | File | Size | Author |
---|---|---|---|
#3 | cron_clear_piwikcache-1902742-3.patch | 431 bytes | patrickd |
Comments
Comment #1
patrickd CreditAttribution: patrickd commentedAre you sure that the statistics have changed since the last cron run?
Why are you sure that they've not been updated?
Is the option "Fill piwik fields on cron run" ticked on? (admin/config/system/piwik -> Advanced options)
Does Filling the fields manually by pressing the "Fill statistical Piwik fields" button help?
Sorry I need more information, to help you here
Comment #2
infines CreditAttribution: infines commentedYes I'm sure the statistics have changed since the last cron run.
I check the statistics pages to find the same numbers as before. (e.g. - hits are still the same number)
Yes the Fill piwik fields on cron run is ticked.
Yes filling the fields manually works.
Comment #3
patrickd CreditAttribution: patrickd commentedSee #1742672: Hardcoded cache lifetime in function piwik_stats_get_xml_data, all statistics are cached for a certain time.
Otherwise it's not possible to update the statistics on cron run in a queued method.
(The XML files pulled from piwik can be large and it may take multiple cron-runs to process it completely)
But we can make sure that after a complete processing of the XML file the cache is cleared.
Please check whether the following patch refreshes your statistics more frequently
Comment #4
infines CreditAttribution: infines commentedShouldn't the statistics be cached according to the drupal cache lifetime set by the user? Or is this more of a Piwik thing?
Comment #5
patrickd CreditAttribution: patrickd commentedI don't understand the question, sorry?
// edit: no this is piwik specific caching
Comment #6
infines CreditAttribution: infines commentedOkay, I'll test the patch today and let you know this afternoon/tonight.
Comment #7
infines CreditAttribution: infines commentedYes this patch seems to be working wonderfully. However I want to continue testing as I noticed my slight loading slowly after the patch was applied (however this could be my office's poor internet connection). I'll let you know later today.
Comment #8
patrickd CreditAttribution: patrickd commentedokay! thanks :)
Comment #9
infines CreditAttribution: infines commentedEverything works fantastic now, thank you! Just one more question what does the "Time to spend filling fields" option indicate? Is it the amount of time that a cron run will spend processing stat updates for a queue of entities (user or node)? Did we eliminate this option with the current patch? If so, would it be better to change this to a number of entities to process at a time (e.g. 10, 100, 1000, or 5000)? Please direct me to any issues with these answers! I have no problem writing documentation!
Comment #10
patrickd CreditAttribution: patrickd commentedCommitted and pushed to 7.x-2.x!
Yes that's what it stands for.
The API for queued cron processing only allows to set a maximum time of seconds to run, not the entities to process itself:
I actually think that it makes more sense to specify how much time it should take - not how much entities it should process,
because the problem is PHP's maximum runtime setting.
See max_execution_time: http://www.php.net/manual/en/info.configuration.php#ini.max-execution-time
thanks!