Ticket #587 (new New feature)
Automatically trigger the archiving script from piwik.php
| Reported by: | matt | Owned by: | |
|---|---|---|---|
| Priority: | major | Milestone: | 4 - Piwik 0.9 - Surviving The Wild |
| Component: | Core | Keywords: | |
| Cc: | Sensitive: | no |
Description (last modified by matt) (diff)
Currently archiving is triggered
- when users request it via the user interface, which could lead to slow loading time
- if users have scheduled automatic triggering as documented in http://piwik.org/docs/setup-auto-archiving/
However, the archiving could be automatically triggered from the piwik.php script.
- script would set timeout to large value, eg. 30minutes
- the auto archiving would be triggered for the website currently hit by piwik.php, to minimize the task ; what happens in the case where 10 archiving for 10 different idsite are triggered at same time? does it conflict at some stage?
- there should be a lock when the process is starting (watchdog) so that it doesn't start multiple time within the "timeout" set earlier. If requests finishes before timeout, then it's good. If not, archving times out, next archiving tries to launch after "timeout" seconds. Maybe we could add a security to do this only a limited number of times, eg. 5 times, before not trying again for that day.
- we can use ignore_user_abort so that archiving keeps working even if user cancels the request (which will likely happen most of time!)
- It should be possible to disable this feature. Timeout should be configurable.
- We should update the doc on http://piwik.org/docs/setup-auto-archiving/
- the timestamp value where auto archiving was last triggered + count failed tries + other values should be saved in the cached tracker file, to avoid DB lookup. value should be persisted in piwik_option table.
- if it is detected that the unix crontab archive.sh script was ran in the last N hour (N==1?), the piwik.php calls will not fire the archiving (as it is already succesfully setup)
- see also #1184
This feature will be useful to increase usability by making UI faster for people without cronjob. Also less users will need to schedule crontab archiving so will save time to Piwik users.
Change History
Note: See
TracTickets for help on using
tickets.
