Add daemon for checking finished jobs

This commit is contained in:
Eike Foken
2011-09-15 18:48:58 +02:00
parent 1496c44505
commit 672f1a5186
4 changed files with 35 additions and 7 deletions

View File

@@ -53,6 +53,23 @@ class Ajax extends CI_Controller {
$this->load->view('global/notifications', $tpl);
}
/**
*
*/
public function check_jobs() {
$this->load->model('job');
$unseen = $this->job->getUnseenResults();
foreach ($unseen as $job) {
$this->job->update($job['id'], array('seen' => 1));
$experiment = anchor('experiments/detail/' . $job['experiment_id'], $job['experiment_name']);
$project = anchor('projects/detail/' . $job['project_id'], $job['project_name']);
$this->messages->add(sprintf(_('The job for %s in project %s is ready.'), $experiment, $project), 'success');
}
}
/**
* Saves the projects description.
*