Skip to content

Allowing idle timeout duration to be controlled in the config #92

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

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
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
3 changes: 3 additions & 0 deletions config/config.yml.default
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,6 @@ defaultPattern: "all"

# show pattern info by default on the "view all" views
defaultShowPatternInfo: false

# set idle timeout duration. defaults to 600s if no value is specified
idleTimeoutDuration: '600'
4 changes: 3 additions & 1 deletion src/PatternLab/Console/Commands/WatchCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,12 @@ public function run() {

} else {

$idleTimeoutDuration = Config::getOption("idleTimeoutDuration") ? Config::getOption("idleTimeoutDuration") : 600;

// a vanilla --watch command needs to have a --no-procs version built
// so we don't get caught in while() loops. re-request the console command
$commands = array();
$commands[] = array("command" => $this->build()." --no-procs", "timeout" => null, "idle" => 600);
$commands[] = array("command" => $this->build()." --no-procs", "timeout" => null, "idle" => $idleTimeoutDuration);

Console::writeInfo("spawning the watch process...");

Expand Down