To receive notifications about scheduled maintenance, please subscribe to the mailing-list gitlab-operations@sympa.ethz.ch. You can subscribe to the mailing-list at https://sympa.ethz.ch

Due to server maintenance gitlab.ethz.ch-users might experience availability-problems on 6/21, between 9:00am and 9.30am.

Commit 55864659 authored by Reto Da Forno's avatar Reto Da Forno

bugfix: only abort test if in status 'preparing' or 'running'

parent e9025ca2
......@@ -1110,14 +1110,16 @@ function update_add_test($xml_config, &$errors, $existing_test_id = NULL, $abort
mysqli_query($db, $sql) or flocklab_die('Cannot abort test: ' . mysqli_error($db));
// update test entry
$end = $r['end_time'];
$sql = 'UPDATE `tbl_serv_tests` SET
`time_end_wish`="'.mysqli_real_escape_string($db, $end->format(DATE_ISO8601)).'",
`test_status`="aborting"
WHERE `serv_tests_key`='.$existing_test_id;
mysqli_query($db, $sql) or flocklab_die('Cannot store test configuration in database because: ' . mysqli_error($db));
$testId = $existing_test_id;
mysqli_close($db);
add_resource_allocation($testId, $resources, $r['start_time']);
// only schedule abort procedure if test has been started and not yet finished
$sql = "SELECT `test_status` FROM tbl_serv_tests WHERE `serv_tests_key`=".$existing_test_id." AND `test_status` IN ('running', 'preparing')";
$res = mysqli_query($db, $sql);
if (mysqli_num_rows($res)) {
$sql = 'UPDATE `tbl_serv_tests` SET `time_end_wish`="'.mysqli_real_escape_string($db, $end->format(DATE_ISO8601)).'", `test_status`="aborting" WHERE `serv_tests_key`='.$existing_test_id;
mysqli_query($db, $sql) or flocklab_die('Cannot store test configuration in database because: ' . mysqli_error($db));
$testId = $existing_test_id;
mysqli_close($db);
add_resource_allocation($testId, $resources, $r['start_time']);
}
}
else {
if (!$r['feasible'])
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment