diff options
author | benakamoorthi <benaka.moorthi@gmail.com> | 2012-04-07 06:30:49 +0400 |
---|---|---|
committer | benakamoorthi <benaka.moorthi@gmail.com> | 2012-04-07 06:30:49 +0400 |
commit | f4d248d5e1792e49a9eea42801a4ab120dc0663f (patch) | |
tree | e006abc7fa499ea4a13ec29637faf8ffeb36f849 /core/ScheduledTask.php | |
parent | 259028c93bdbe8bb19156bfe92d0c7dc5e47a336 (diff) |
Fixes #53. Augmented the log data deletion feature. Added the ability to purge old reports and metrics.
Other changes:
* Added the following plugin functions: Piwik_DropTables, Piwik_OptimizeTables, Piwik_DeleteAllRows. Also refactored existing code to use them.
* Modified graph, tag cloud & datatable templates/views to show a different message if there's no data for a report and if its possible that report was purged.
* Refactored DbStats API, added getAllTablesStatus method that doesn't modify the SHOW TABLE STATUS result.
* Deletelogs config options are now stored in the DB.
* Added task priority support to the TaskScheduler.
git-svn-id: http://dev.piwik.org/svn/trunk@6174 59fd770c-687e-43c8-a1e3-f5a4ff64c105
Diffstat (limited to 'core/ScheduledTask.php')
-rw-r--r-- | core/ScheduledTask.php | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/core/ScheduledTask.php b/core/ScheduledTask.php index 4f855cb495..b1e5ee63bc 100644 --- a/core/ScheduledTask.php +++ b/core/ScheduledTask.php @@ -18,6 +18,10 @@ */ class Piwik_ScheduledTask { + const LOW_PRIORITY = 2; + const NORMAL_PRIORITY = 1; + const HIGH_PRIORITY = 0; + /** * Class name where the specified method is located * @var string @@ -35,12 +39,19 @@ class Piwik_ScheduledTask * @var Piwik_ScheduledTime */ var $scheduledTime; + + /** + * The priority of a task. Affects the order in which this task will be run. + * @var int + */ + var $priority; - function __construct( $_className, $_methodName, $_scheduledTime) + function __construct( $_className, $_methodName, $_scheduledTime, $_priority = self::NORMAL_PRIORITY ) { $this->className = $_className; $this->methodName = $_methodName; $this->scheduledTime = $_scheduledTime; + $this->priority = $_priority; } /* @@ -69,4 +80,15 @@ class Piwik_ScheduledTask { return $this->scheduledTime; } + + /** + * Returns the task priority. The priority will be an integer whose value is + * between Piwik_ScheduledTask::HIGH_PRIORITY and Piwik_ScheduledTask::LOW_PRIORITY. + * + * @return int + */ + public function getPriority() + { + return $this->priority; + } } |