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

Commit caeb7e4

Browse files
Merge pull request #59 from loveOSS/fix/timeout-validation
Fixed misleading timeout
2 parents a31f20a + 9b0b2b8 commit caeb7e4

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/Systems/MainSystem.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,11 @@ private static function validate(array $settings): bool
9797

9898
private static function validateTimeout(int $timeout): bool
9999
{
100+
// @doc https://www.php.net/manual/info.configuration.php the timeout is in seconds
100101
$maxExecutionTime = ini_get('max_execution_time');
102+
103+
$timeoutInSeconds = (int) ($timeout / 1000);
101104

102-
return (0 === (int) $maxExecutionTime) || ($maxExecutionTime >= $timeout);
105+
return (0 === (int) $maxExecutionTime) || ($maxExecutionTime >= $timeoutInSeconds);
103106
}
104107
}

0 commit comments

Comments
 (0)