Skip to content
Snippets Groups Projects
Commit 3c8059eb authored by a.croix's avatar a.croix
Browse files

Change processor to set training flag to true juste before the training step of the job

parent 5dc106a1
No related branches found
No related tags found
1 merge request!1Include Wowa Training
......@@ -101,6 +101,8 @@ class WowaJob implements ShouldQueue
$trainer = new Trainer($training_prameters, new SolutionDistance(count($this->evidences[0])));
$this->wowa->status = Wowa::STATE_RUNNING;
$this->wowa->save();
$processor->setTrainingBooleanTrue();
$logg->pushProcessor($processor);
try {
$solution = $trainer->run($this->evidences, $this->is_true_alert);
} catch (\Exception $e) {
......
......@@ -7,11 +7,13 @@ class LogProcessor
{
protected $job_id;
protected $training_bool = false;
public function __invoke(array $record): array
{
$record['extra'] = [
'user_id' => auth()->user() ? auth()->user()->id : null,
'job_id' => $this->job_id
'job_id' => $this->job_id,
'training' => $this->training_bool
];
return $record;
}
......@@ -20,4 +22,9 @@ class LogProcessor
{
$this->job_id = $job_id;
}
public function setTrainingBooleanTrue()
{
$this->training_bool = true;
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment