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

Correction in progression display : getJobProgression method

parent e0379778
No related branches found
No related tags found
1 merge request!1Include Wowa Training
Pipeline #6111 failed
......@@ -13,20 +13,21 @@ class Log extends Model
public static function getJobProgression(Wowa $wowa)
{
$logs = self::where('job_id', '=', $wowa->id)->orderBy('progression', 'desc')->first();
if (!is_object($logs)) {
return "Calculation in progress...";
} elseif ($wowa->status == Wowa::STATE_COLLECTION) {
if ($wowa->status == Wowa::STATE_COLLECTION) {
$log = self::where('job_id', '=', $wowa->id)
->where('training', '=', false)->orderBy('progression', 'desc')->first();
return $log->progression;
} elseif ($wowa->status == Wowa::STATE_RUNNING || $wowa->status == Wowa::STATE_SUCCESS) {
} elseif ($wowa->status == Wowa::STATE_RUNNING) {
$log = self::where('job_id', '=', $wowa->id)
->where('training', '=', true)->orderBy('progression', 'desc')->first();
if (!is_object($log)) {
return "Calculation progress...";
}
return ((($log->progression + 1) / $wowa->generation_number) * 100);
} elseif ($wowa->status == Wowa::STATE_SUCCESS) {
return "100";
} elseif ($wowa->status == Wowa::STATE_QUEUED) {
return "Computation in progress";
} else {
return 'Error';
}
......
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