1
0

feat: remove default timeout

This commit is contained in:
dump_stack() 2023-05-26 16:57:57 +00:00
parent 673b273593
commit 852680e944
Signed by: dump_stack
GPG Key ID: BE44DA8C062D87DC

View File

@ -29,7 +29,7 @@ var Runtime = "docker"
var Registry = "" var Registry = ""
var Timeout = 8 * time.Minutes var Timeout time.Duration
var Commands []config.DockerCommand var Commands []config.DockerCommand
@ -314,6 +314,7 @@ func (c Container) Run(workdir string, cmds []string) (out string, err error) {
} }
cmd.Stderr = cmd.Stdout cmd.Stderr = cmd.Stdout
if Timeout != 0 {
timer := time.AfterFunc(Timeout, func() { timer := time.AfterFunc(Timeout, func() {
flog.Info().Msg("killing container by timeout") flog.Info().Msg("killing container by timeout")
@ -326,6 +327,7 @@ func (c Container) Run(workdir string, cmds []string) (out string, err error) {
cmd.Process.Kill() cmd.Process.Kill()
}) })
defer timer.Stop() defer timer.Stop()
}
err = cmd.Start() err = cmd.Start()
if err != nil { if err != nil {