Skip to content
This repository has been archived by the owner on Aug 17, 2022. It is now read-only.

Commit

Permalink
Merge pull request #59 from loveOSS/fix/timeout-validation
Browse files Browse the repository at this point in the history
Fixed misleading timeout
  • Loading branch information
mickaelandrieu committed Sep 4, 2021
2 parents a31f20a + 9b0b2b8 commit caeb7e4
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/Systems/MainSystem.php
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,11 @@ private static function validate(array $settings): bool

private static function validateTimeout(int $timeout): bool
{
// @doc https://www.php.net/manual/info.configuration.php the timeout is in seconds
$maxExecutionTime = ini_get('max_execution_time');

$timeoutInSeconds = (int) ($timeout / 1000);

return (0 === (int) $maxExecutionTime) || ($maxExecutionTime >= $timeout);
return (0 === (int) $maxExecutionTime) || ($maxExecutionTime >= $timeoutInSeconds);
}
}

0 comments on commit caeb7e4

Please sign in to comment.