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:
@@ -1735,7 +1735,9 @@ function update_row_quota($questionnaire_id,$case_id = false)
|
|||||||
if ($r['autoprioritise'] == 1)
|
if ($r['autoprioritise'] == 1)
|
||||||
{
|
{
|
||||||
//priority is 100 - the percentage of completions
|
//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' ";
|
$sql .= ", priority = '$pr' ";
|
||||||
|
|
||||||
//need to update quotas now
|
//need to update quotas now
|
||||||
|
|||||||
@@ -76,7 +76,6 @@ function is_process_killed($process_id)
|
|||||||
$sql = "SELECT `process_id`
|
$sql = "SELECT `process_id`
|
||||||
FROM `process`
|
FROM `process`
|
||||||
WHERE `kill` = 1
|
WHERE `kill` = 1
|
||||||
AND `stop` IS NULL
|
|
||||||
AND `process_id` = '$process_id'";
|
AND `process_id` = '$process_id'";
|
||||||
|
|
||||||
$rs = $db->GetRow($sql);
|
$rs = $db->GetRow($sql);
|
||||||
|
|||||||
Reference in New Issue
Block a user