2
0
mirror of https://github.com/ACSPRI/queXS synced 2024-04-02 12:12:16 +00:00

Make sure quota priority is never less than 0

Fixed bug: Process won't close itself if forced killed before it has a chance to close
This commit is contained in:
Adam Zammit
2014-07-10 15:07:46 +10:00
parent 2f9e52af77
commit 88b6f9d369
2 changed files with 3 additions and 2 deletions

View File

@@ -1735,7 +1735,9 @@ function update_row_quota($questionnaire_id,$case_id = false)
if ($r['autoprioritise'] == 1)
{
//priority is 100 - the percentage of completions
$pr = 100 - round(100 * ($completions / $r['completions']));
$pr = 100 - round(100 * ($completions / $r['completions']));
if ($pr < 0)
$pr = 0;
$sql .= ", priority = '$pr' ";
//need to update quotas now

View File

@@ -76,7 +76,6 @@ function is_process_killed($process_id)
$sql = "SELECT `process_id`
FROM `process`
WHERE `kill` = 1
AND `stop` IS NULL
AND `process_id` = '$process_id'";
$rs = $db->GetRow($sql);