Fixes for ADSL traffic collection and other ADSL items
This commit is contained in:
@@ -17,7 +17,7 @@ class Model_Task extends ORM_OSB {
|
||||
),
|
||||
);
|
||||
|
||||
public function run() {
|
||||
public function run($force=FALSE) {
|
||||
$r = rand(0,9999);
|
||||
$tlo = ORM::factory('Task_Log');
|
||||
$tlo->task_id = $this->id;
|
||||
@@ -28,7 +28,7 @@ class Model_Task extends ORM_OSB {
|
||||
elseif (! $this->status)
|
||||
$tlo->message = sprintf('Task %s is not active',$this->id);
|
||||
|
||||
elseif ($this->running)
|
||||
elseif ($this->running AND ! $force)
|
||||
$tlo->message = sprintf('Task %s is already running',$this->id);
|
||||
|
||||
elseif (! preg_match('/\//',$this->command))
|
||||
|
@@ -12,7 +12,7 @@
|
||||
*/
|
||||
class Task_Task_Run extends Task {
|
||||
protected function _execute(array $params) {
|
||||
if (isset($params['id'])) {
|
||||
if ($params['id']) {
|
||||
$to = ORM::factory('Task',$params['id']);
|
||||
|
||||
if ($to->loaded()) {
|
||||
@@ -20,7 +20,7 @@ class Task_Task_Run extends Task {
|
||||
throw new Minion_Exception_InvalidTask('Task :task (:name) NOT active',array(':task'=>$params['id'],':name'=>$to->name));
|
||||
|
||||
if (! Kohana::$config->load('debug')->task_sim)
|
||||
$to->run();
|
||||
$to->run($params['force']);
|
||||
else
|
||||
printf('Would Run task: (%s) %s',$params['id'],$to->name);
|
||||
|
||||
|
Reference in New Issue
Block a user