Skip to content
This repository was archived by the owner on Apr 12, 2019. It is now read-only.

Commit 2c3dc95

Browse files
lunnyappleboy
authored andcommitted
Set default command execution timeout as changable (#104)
* set default command execution timeout as changable * fix lint
1 parent a34aca9 commit 2c3dc95

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

command.go

+4-1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ import (
1717
var (
1818
// GlobalCommandArgs global command args for external package setting
1919
GlobalCommandArgs []string
20+
21+
// DefaultCommandExecutionTimeout default command execution timeout duration
22+
DefaultCommandExecutionTimeout = 60 * time.Second
2023
)
2124

2225
// Command represents a command with its subcommands or arguments.
@@ -50,7 +53,7 @@ func (c *Command) AddArguments(args ...string) *Command {
5053
// it pipes stdout and stderr to given io.Writer.
5154
func (c *Command) RunInDirTimeoutPipeline(timeout time.Duration, dir string, stdout, stderr io.Writer) error {
5255
if timeout == -1 {
53-
timeout = 60 * time.Second
56+
timeout = DefaultCommandExecutionTimeout
5457
}
5558

5659
if len(dir) == 0 {

0 commit comments

Comments
 (0)