Misc fixes from live site
This commit is contained in:
@@ -18,7 +18,7 @@ class Task_Task_Run extends Minion_Task {
|
||||
if (! $to->status)
|
||||
throw new Minion_Exception_InvalidTask('Task :task (:name) NOT active',array(':task'=>$params['id'],':name'=>$to->name));
|
||||
|
||||
Kohana::$config->load('debug')->task_sim ? printf("Would Run task: (%s) %s\n",$to->id,$to->name) : $this->_run($to,$params['force']);
|
||||
Kohana::$config->load('debug')->task_sim ? printf("Would Run task: (%s) %s\n",$to->id,$to->name) : $this->_run($to,$params['force'],$params['verbose']);
|
||||
|
||||
} else
|
||||
throw new Minion_Exception_InvalidTask('Unknown task :task',array(':task'=>$params['id']));
|
||||
@@ -32,7 +32,10 @@ class Task_Task_Run extends Minion_Task {
|
||||
}
|
||||
}
|
||||
|
||||
private function _run(Model_Task $to,$force=FALSE) {
|
||||
private function _run(Model_Task $to,$force=FALSE,$verbose=FALSE) {
|
||||
if ($verbose)
|
||||
printf("Running Task: %s\n",$to->id);
|
||||
|
||||
$r = rand(0,9999);
|
||||
$tlo = ORM::factory('Task_Log');
|
||||
$tlo->task_id = $to->id;
|
||||
@@ -95,6 +98,9 @@ class Task_Task_Run extends Minion_Task {
|
||||
$to->save();
|
||||
}
|
||||
|
||||
if ($verbose)
|
||||
printf("Message: %s\n",$tlo->message);
|
||||
|
||||
if ($to->log)
|
||||
$tlo->save();
|
||||
}
|
||||
|
Reference in New Issue
Block a user