Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Task Scheduler Improvements #3704

Closed
julienmoumne opened this issue Jan 23, 2013 · 9 comments
Closed

Task Scheduler Improvements #3704

julienmoumne opened this issue Jan 23, 2013 · 9 comments
Assignees
Labels
Task Indicates an issue is neither a feature nor a bug and it's purely a "technical" change.
Milestone

Comments

@julienmoumne
Copy link
Member

  1. Task parameters

It is currently not possible to schedule the execution of a method with parameters, see TaskScheduler.php#L98

This is required to be able to send PDF/HTML/SMS at different times, see #3706.

In a first iteration, only one parameter will be supported.

  1. Timetable cleanup

Tasks that are being scheduled are stored in the option table in the option name "TaskScheduler.timetable".

In future updates of Piwik, if a scheduled task is not needed anymore, it would not be removed from the option table.

  1. Do not execute a newly created task

Currently, if a task has never been executed, it will be executed as soon as the runTasks() method retrieves the new task via the Piwik_PostEvent() method.

See TaskScheduler.php#L80 :

/*
 * Task has to be executed if :
 *      - it is the first time, ie. rescheduledTime is not set
 *  - that task has already been executed and the current system time is greater than the
 *    rescheduled time.
 */

The task should only be scheduled and not run.

Note: do not break the $forceScheduledTasks feature.

@julienmoumne
Copy link
Member Author

(In [7790]) fixes #3704 #3706

@julienmoumne
Copy link
Member Author

(In [7791]) refs #3704 #3706 r7790 missing test updates

@julienmoumne
Copy link
Member Author

(In [7792]) refs #3704 #3706 r7790 time() in unit tests needs to be made invariant for slow machines

@mattab
Copy link
Member

mattab commented Jan 28, 2013

(In [7803]) I can replicate failure locally by executing: phpunit --filter TaskScheduler
Temporarily disabling the tests that stub the Option object, which I think may be causing the problem? refs #3704 #3706

@mattab
Copy link
Member

mattab commented Jan 28, 2013

(In [7808]) small UX chagne + trigger update refs #3704 #3706

@mattab
Copy link
Member

mattab commented Jan 28, 2013

(In [7810]) Re-enabling tests refs #3704 #3706

@julienmoumne
Copy link
Member Author

(In [7813]) refs #3704 #3706 r7790

  • fix test for slow execution
  • re-enable tests

@julienmoumne
Copy link
Member Author

(In [7814]) refs #3704 #3706 r7790 restore event dispatcher & piwik options

@julienmoumne
Copy link
Member Author

(In [7820]) refs #3704 #3706 r7790 restore Piwik_PDFReports_API

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Task Indicates an issue is neither a feature nor a bug and it's purely a "technical" change.
Projects
None yet
Development

No branches or pull requests

2 participants