Files
docker-cli/vendor/github.com/Microsoft/hcsshim/internal/timeout/timeout.go
Andrew Hsu 4e6798794d vndr docker/docker to docker/engine d2ecc7b
And update the associated packages that have also updated from
docker/docker vendor.conf.

Signed-off-by: Andrew Hsu <andrewhsu@docker.com>
2018-09-05 17:35:51 +00:00

27 lines
600 B
Go

package timeout
import (
"os"
"strconv"
"time"
)
// Duration is the default time to wait for various operations.
// - Waiting for async notifications from HCS
// - Waiting for processes to launch through
// - Waiting to copy data to/from a launched processes stdio pipes.
//
// This can be overridden through environment variable `HCS_TIMEOUT_SECONDS`
var Duration = 4 * time.Minute
func init() {
envTimeout := os.Getenv("HCSSHIM_TIMEOUT_SECONDS")
if len(envTimeout) > 0 {
e, err := strconv.Atoi(envTimeout)
if err == nil && e > 0 {
Duration = time.Second * time.Duration(e)
}
}
}