Skip to content

Commit 2ccb868

Browse files
committed
minor symfony#10097 [Process] clarify idle timeout (Tobion)
This PR was merged into the 2.4 branch. Discussion ---------- [Process] clarify idle timeout | Q | A | ------------- | --- | Bug fix? | sort of | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | - | License | MIT | Doc PR | n/a Makes idle timeout in line with symfony#9466 Commits ------- 9f07b4d [Process] clarify idle timeout
2 parents 783a45d + 9f07b4d commit 2ccb868

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

src/Symfony/Component/Process/Process.php

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -730,7 +730,7 @@ public function setCommandLine($commandline)
730730
}
731731

732732
/**
733-
* Gets the process timeout.
733+
* Gets the process timeout (max. runtime).
734734
*
735735
* @return float|null The timeout in seconds or null if it's disabled
736736
*/
@@ -740,17 +740,17 @@ public function getTimeout()
740740
}
741741

742742
/**
743-
* Gets the process idle timeout.
743+
* Gets the process idle timeout (max. time since last output).
744744
*
745-
* @return float|null
745+
* @return float|null The timeout in seconds or null if it's disabled
746746
*/
747747
public function getIdleTimeout()
748748
{
749749
return $this->idleTimeout;
750750
}
751751

752752
/**
753-
* Sets the process timeout.
753+
* Sets the process timeout (max. runtime).
754754
*
755755
* To disable the timeout, set this value to null.
756756
*
@@ -768,9 +768,11 @@ public function setTimeout($timeout)
768768
}
769769

770770
/**
771-
* Sets the process idle timeout.
771+
* Sets the process idle timeout (max. time since last output).
772772
*
773-
* @param integer|float|null $timeout
773+
* To disable the timeout, set this value to null.
774+
*
775+
* @param integer|float|null $timeout The timeout in seconds
774776
*
775777
* @return self The current Process instance.
776778
*
@@ -991,7 +993,7 @@ public function checkTimeout()
991993
throw new ProcessTimedOutException($this, ProcessTimedOutException::TYPE_GENERAL);
992994
}
993995

994-
if (0 < $this->idleTimeout && $this->idleTimeout < microtime(true) - $this->lastOutputTime) {
996+
if (null !== $this->idleTimeout && $this->idleTimeout < microtime(true) - $this->lastOutputTime) {
995997
$this->stop(0);
996998

997999
throw new ProcessTimedOutException($this, ProcessTimedOutException::TYPE_IDLE);

0 commit comments

Comments
 (0)