summaryrefslogtreecommitdiff
path: root/app/Services/TimeoutService.php
diff options
context:
space:
mode:
Diffstat (limited to 'app/Services/TimeoutService.php')
-rw-r--r--app/Services/TimeoutService.php26
1 files changed, 4 insertions, 22 deletions
diff --git a/app/Services/TimeoutService.php b/app/Services/TimeoutService.php
index d59cce78fa..eb0598478a 100644
--- a/app/Services/TimeoutService.php
+++ b/app/Services/TimeoutService.php
@@ -19,23 +19,19 @@ declare(strict_types=1);
namespace Fisharebest\Webtrees\Services;
-use Psr\Http\Message\ServerRequestInterface;
-
-use function app;
-
/**
* Check for PHP timeouts.
*/
class TimeoutService
{
- /** @var float Long-running scripts run in small chunks */
+ //Long-running scripts run in small chunks
private const TIME_LIMIT = 1.5;
- /** @var float Seconds until we run out of time */
+ // Seconds until we run out of time
private const TIME_UP_THRESHOLD = 3.0;
- /** @var float|null The start time of the request */
- private $start_time;
+ // The start time of the request
+ private float $start_time;
/**
* TimeoutService constructor.
@@ -81,18 +77,4 @@ class TimeoutService
return $now > $this->start_time + $limit;
}
-
- /**
- * @return float
- */
- protected function startTime(): float
- {
- if ($this->start_time === null) {
- $request = app(ServerRequestInterface::class);
-
- $this->start_time = (float) ($request->getServerParams()['REQUEST_TIME_FLOAT'] ?? microtime(true));
- }
-
- return $this->start_time;
- }
}