diff --git a/lib/SetupChecks/LogErrors.php b/lib/SetupChecks/LogErrors.php index 6681ebacd..1d8a228ce 100644 --- a/lib/SetupChecks/LogErrors.php +++ b/lib/SetupChecks/LogErrors.php @@ -61,6 +61,7 @@ public function run(): SetupResult { self::LEVEL_FATAL => 0, ]; $limit = new \DateTime('7 days ago'); + $startTime = microtime(true); foreach ($logIterator as $logItem) { if (!isset($logItem['time'])) { continue; @@ -70,16 +71,20 @@ public function run(): SetupResult { break; } $count[$logItem['level']]++; + if (microtime(true) > $startTime + 5) { + $limit = $time; + break; + } } if (array_sum($count) === 0) { - return SetupResult::success($this->l10n->t('No errors in the logs since %s', $this->dateFormatter->formatDate($limit))); + return SetupResult::success($this->l10n->t('No errors in the logs since %s', $this->dateFormatter->formatDateTime($limit))); } elseif ($count[self::LEVEL_ERROR] + $count[self::LEVEL_FATAL] > 0) { return SetupResult::warning( $this->l10n->n( '%n error in the logs since %s', '%n errors in the logs since %s', $count[self::LEVEL_ERROR] + $count[self::LEVEL_FATAL], - [$this->dateFormatter->formatDate($limit)], + [$this->dateFormatter->formatDateTime($limit)], ) ); } else { @@ -88,7 +93,7 @@ public function run(): SetupResult { '%n warning in the logs since %s', '%n warnings in the logs since %s'.json_encode($count), $count[self::LEVEL_WARNING], - [$this->dateFormatter->formatDate($limit)], + [$this->dateFormatter->formatDateTime($limit)], ) ); }