소스 검색

Merge pull request #1666 from jessehickman/patch-4

Add custom timeout to healthchecks API
causefx 5 년 전
부모
커밋
2000c15fa2
1개의 변경된 파일과 6개의 추가작업 그리고 1개의 파일을 삭제
  1. 6 1
      api/plugins/healthChecks.php

+ 6 - 1
api/plugins/healthChecks.php

@@ -136,6 +136,11 @@ class HealthChecks extends Organizr
 					unset($allItems[$k]);
 				}
 			}
+			$limit = 30;
+			if (!empty($allItems)){
+				$limit = count($allItems) * 20;
+			}
+			set_time_limit($limit);
 			foreach ($allItems as $k => $v) {
 				$testLocal = $v['Internal URL'] !== '' ?? false;
 				$testExternal = $v['External URL'] !== '' ?? false;
@@ -171,4 +176,4 @@ class HealthChecks extends Organizr
 			$this->setAPIResponse('error', 'User does not have access', 401);
 		}
 	}
-}
+}