Mariusz Muszyński 8 лет назад
Родитель
Сommit
427f0794e9
1 измененных файлов с 15 добавлено и 11 удалено
  1. 15 11
      SE/se-lib/Route/UrlAction/BiAuditGenerate.php

+ 15 - 11
SE/se-lib/Route/UrlAction/BiAuditGenerate.php

@@ -2428,17 +2428,21 @@ class BiAuditPowiazania {
 	}
 
 	public function findPowiazania($ID, $progress = 0, $steps = 1, $relation = "", $weight = 0) {
-		if (((++$this->step) % 1000000) == 0) {
-			$progressDiff = $progress - $this->lastProgress_slowCheck;
-			if ($progressDiff < 0.00005) {
-				$this->lowProgressCount++;
-				if ($this->lowProgressCount == 10) {
-					$this->maxDepth--;
-					self::saveToLog("Zbyt dużo rekurencji, zmniejszono maksymalną głębokość poszukiwań do {$this->maxDepth} dla bieżącego obiektu");
-					$this->lowProgressCount = 0;
-				}
-			} else $this->lowProgressCount = 0;
-			$this->lastProgress_slowCheck = $progress;
+		$this->step++;
+
+		if ($this->maxDepth > $this->minDepth) {
+			if (($this->step % 1000000) == 0) {
+				$progressDiff = $progress - $this->lastProgress_slowCheck;
+				if ($progressDiff < 0.00005) {
+					$this->lowProgressCount++;
+					if ($this->lowProgressCount == 10) {
+						$this->maxDepth--;
+						self::saveToLog("Zbyt dużo rekurencji, zmniejszono maksymalną głębokość poszukiwań do {$this->maxDepth} dla bieżącego obiektu");
+						$this->lowProgressCount = 0;
+					}
+				} else $this->lowProgressCount = 0;
+				$this->lastProgress_slowCheck = $progress;
+			}
 		}
 
 		if ((($this->step) % 100000) == 0) {