Index: trunk/MagicSoft/Mars/datacenter/db/include.php
===================================================================
--- trunk/MagicSoft/Mars/datacenter/db/include.php	(revision 9451)
+++ trunk/MagicSoft/Mars/datacenter/db/include.php	(revision 9486)
@@ -50,6 +50,10 @@
 }
 
-function StatusQuery($name, $needs)
-{
+function StatusQuery($name, $needs, $timelimits)
+{
+    if (empty($timelimits[$name]))
+        $timelimit="12";
+    else
+        $timelimit=$timelimits[$name];
     $var  = $name . "Status";
     $txt  = "";
@@ -61,7 +65,7 @@
     case 2: $txt .= "IsNull(" . $name . ") AND "; break; //not done no matter what status of previous step is
     case 3: $txt .= $name ."='1970-01-01 00:00:00' AND "; break;
-    case 4: $txt .= " (IsNull(" . $name . ") AND IsNull(fFailedTime) AND NOT IsNull(fStartTime) AND date_sub(Now(),interval 12 hour) < fStartTime AND NOT IsNull(" . $needs[$name] . ")) AND "; break;
+    case 4: $txt .= " (IsNull(" . $name . ") AND IsNull(fFailedTime) AND NOT IsNull(fStartTime) AND date_sub(Now(),interval " . $timelimit . " hour) < fStartTime AND NOT IsNull(" . $needs[$name] . ")) AND "; break;
     case 5: $txt .= " (IsNull(" . $name . ") AND NOT IsNull(fFailedTime) AND NOT IsNull(fStartTime) AND NOT IsNull(" . $needs[$name] . ")) AND "; break;
-    case 6: $txt .= " (IsNull(" . $name . ") AND IsNull(fFailedTime) AND NOT IsNull(fStartTime) AND date_sub(Now(),interval 12 hour) > fStartTime AND NOT IsNull(" . $needs[$name] . ")) AND "; break;
+    case 6: $txt .= " (IsNull(" . $name . ") AND IsNull(fFailedTime) AND NOT IsNull(fStartTime) AND date_sub(Now(),interval " . $timelimit . " hour) > fStartTime AND NOT IsNull(" . $needs[$name] . ")) AND "; break;
 //    case 6: $txt .= "crashed"; break;
     case 7: $txt .= ""; break;
