Skip to content

Commit

Permalink
Fixed re-run when software is not found
Browse files Browse the repository at this point in the history
  • Loading branch information
zagganas committed May 17, 2022
1 parent f9304b5 commit 2bef973
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
18 changes: 15 additions & 3 deletions controllers/SoftwareController.php
Original file line number Diff line number Diff line change
Expand Up @@ -921,7 +921,9 @@ public function actionRerun($jobid)

if (empty($history))
{
return $this->render('job_not_found',['jobid'=>$jobid]);
$message="Job $jobid could not be found in our system.";
Yii::$app->session->setFlash('danger', "$message");
return $this->redirect(['software/history']);
}

/*
Expand Down Expand Up @@ -1004,7 +1006,9 @@ public function actionReattach($jobid)
$history=RunHistory::find()->where(['jobid'=>$jobid])->one();
if (empty($history))
{
return $this->render('job_not_found',['jobid'=>$jobid]);
$message="Job $jobid could not be found in our system.";
Yii::$app->session->setFlash('danger', "$message");
return $this->redirect(['software/history']);
}

$name=$history->softname;
Expand All @@ -1015,7 +1019,15 @@ public function actionReattach($jobid)
$maxMem=$history->max_ram;
$maxCores=$history->max_cpu;
$outFolder=$history->omountpoint;
$software=Software::find()->where(['name'=>$name,'version'=>$version])->one();
$software=Software::find()->where(['id'=>$history->software_id])->one();

if (empty($software))
{
$message="The software for job $jobid could not be found in our system.";
Yii::$app->session->setFlash('danger', "$message");
return $this->redirect(['software/history']);
}

$software->jobid=$jobid;
$uploadedBy=$software->uploaded_by;

Expand Down
2 changes: 1 addition & 1 deletion models/Software.php
Original file line number Diff line number Diff line change
Expand Up @@ -472,7 +472,7 @@ public static function getIOs($software,$fields,$iSystemFolder,$oSystemFolder)
{
$url="s3://" . $username . '/' . $field->value;
}
$path=$software->imountpoint;
$path=$software->imountpoint . '/' . $field->value;
$type='DIRECTORY';
}
else
Expand Down

0 comments on commit 2bef973

Please sign in to comment.