Skip to content
Snippets Groups Projects
Commit 3a56d749 authored by Ruud Overeem's avatar Ruud Overeem
Browse files

Bug 1284: Added '0' group for the SAS scheduler.

parent 8a0e050a
No related branches found
No related tags found
No related merge requests found
...@@ -25,7 +25,8 @@ ...@@ -25,7 +25,8 @@
-- --
-- getTreesInPeriod (groupType, periodInMinutes) -- getTreesInPeriod (groupType, periodInMinutes)
-- --
-- groupType = 1: get all trees that are scheduled to start in the period: now till now+period -- groupType = 0: get all trees that have to be scheduled
-- 1: get all trees that are scheduled to start in the period: now till now+period
-- 2: get all trees with starttime <=now and stoptime > now ; period param is ignored -- 2: get all trees with starttime <=now and stoptime > now ; period param is ignored
-- 3: get all trees with stoptime in the period: now-period till now -- 3: get all trees with stoptime in the period: now-period till now
-- --
...@@ -52,6 +53,9 @@ CREATE OR REPLACE FUNCTION getTreeGroup(INT, INT) ...@@ -52,6 +53,9 @@ CREATE OR REPLACE FUNCTION getTreeGroup(INT, INT)
BEGIN BEGIN
vQuery := \'\'; vQuery := \'\';
IF $1 = 0 THEN
vQuery := \' AND (t.stoptime > now() OR t.stoptime IS NULL) \';
ELSE
IF $1 = 1 THEN IF $1 = 1 THEN
vQuery := \' AND (t.state = \' || TSscheduled || \' OR t.state = \' || TSqueued || \') \'; vQuery := \' AND (t.state = \' || TSscheduled || \' OR t.state = \' || TSqueued || \') \';
-- vQuery := vQuery || \' AND t.starttime < now()+interval \' || chr(39) || $2 || \' minutes\' || chr(39); -- vQuery := vQuery || \' AND t.starttime < now()+interval \' || chr(39) || $2 || \' minutes\' || chr(39);
...@@ -66,7 +70,8 @@ CREATE OR REPLACE FUNCTION getTreeGroup(INT, INT) ...@@ -66,7 +70,8 @@ CREATE OR REPLACE FUNCTION getTreeGroup(INT, INT)
vQuery := \' AND t.state >= \' || TSfinished; vQuery := \' AND t.state >= \' || TSfinished;
vQuery := vQuery || \' AND t.stoptime > now()-interval \' || chr(39) || $2 || \' minutes\' || chr(39); vQuery := vQuery || \' AND t.stoptime > now()-interval \' || chr(39) || $2 || \' minutes\' || chr(39);
ELSE ELSE
RAISE EXCEPTION \'groupType must be 1,2 or 3 not %\', $1; RAISE EXCEPTION \'groupType must be 0,1,2 or 3 not %\', $1;
END IF;
END IF; END IF;
END IF; END IF;
END IF; END IF;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment