Added QueueManager to process background jobs
This commit is contained in:
40
app/Job/ProjectMetricJob.php
Normal file
40
app/Job/ProjectMetricJob.php
Normal file
@@ -0,0 +1,40 @@
|
||||
<?php
|
||||
|
||||
namespace Kanboard\Job;
|
||||
|
||||
/**
|
||||
* Class ProjectMetricJob
|
||||
*
|
||||
* @package Kanboard\Job
|
||||
* @author Frederic Guillot
|
||||
*/
|
||||
class ProjectMetricJob extends BaseJob
|
||||
{
|
||||
/**
|
||||
* Set job parameters
|
||||
*
|
||||
* @access public
|
||||
* @param integer $projectId
|
||||
* @return $this
|
||||
*/
|
||||
public function withParams($projectId)
|
||||
{
|
||||
$this->jobParams = array($projectId);
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Execute job
|
||||
*
|
||||
* @access public
|
||||
* @param integer $projectId
|
||||
*/
|
||||
public function execute($projectId)
|
||||
{
|
||||
$this->logger->debug(__METHOD__.' Run project metrics calculation');
|
||||
$now = date('Y-m-d');
|
||||
|
||||
$this->projectDailyColumnStats->updateTotals($projectId, $now);
|
||||
$this->projectDailyStats->updateTotals($projectId, $now);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user