Skip to content

[Process] clarify idle timeout #10097

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 24, 2014
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 9 additions & 7 deletions src/Symfony/Component/Process/Process.php
Original file line number Diff line number Diff line change
Expand Up @@ -730,7 +730,7 @@ public function setCommandLine($commandline)
}

/**
* Gets the process timeout.
* Gets the process timeout (max. runtime).
*
* @return float|null The timeout in seconds or null if it's disabled
*/
Expand All @@ -740,17 +740,17 @@ public function getTimeout()
}

/**
* Gets the process idle timeout.
* Gets the process idle timeout (max. time since last output).
*
* @return float|null
* @return float|null The timeout in seconds or null if it's disabled
*/
public function getIdleTimeout()
{
return $this->idleTimeout;
}

/**
* Sets the process timeout.
* Sets the process timeout (max. runtime).
*
* To disable the timeout, set this value to null.
*
Expand All @@ -768,9 +768,11 @@ public function setTimeout($timeout)
}

/**
* Sets the process idle timeout.
* Sets the process idle timeout (max. time since last output).
*
* @param integer|float|null $timeout
* To disable the timeout, set this value to null.
*
* @param integer|float|null $timeout The timeout in seconds
*
* @return self The current Process instance.
*
Expand Down Expand Up @@ -991,7 +993,7 @@ public function checkTimeout()
throw new ProcessTimedOutException($this, ProcessTimedOutException::TYPE_GENERAL);
}

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

throw new ProcessTimedOutException($this, ProcessTimedOutException::TYPE_IDLE);
Expand Down