feat: remove default timeout
This commit is contained in:
parent
673b273593
commit
852680e944
@ -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,18 +314,20 @@ func (c Container) Run(workdir string, cmds []string) (out string, err error) {
|
|||||||
}
|
}
|
||||||
cmd.Stderr = cmd.Stdout
|
cmd.Stderr = cmd.Stdout
|
||||||
|
|
||||||
timer := time.AfterFunc(Timeout, func() {
|
if Timeout != 0 {
|
||||||
flog.Info().Msg("killing container by timeout")
|
timer := time.AfterFunc(Timeout, func() {
|
||||||
|
flog.Info().Msg("killing container by timeout")
|
||||||
|
|
||||||
flog.Debug().Msg("SIGINT")
|
flog.Debug().Msg("SIGINT")
|
||||||
cmd.Process.Signal(os.Interrupt)
|
cmd.Process.Signal(os.Interrupt)
|
||||||
|
|
||||||
time.Sleep(time.Minute)
|
time.Sleep(time.Minute)
|
||||||
|
|
||||||
flog.Debug().Msg("SIGKILL")
|
flog.Debug().Msg("SIGKILL")
|
||||||
cmd.Process.Kill()
|
cmd.Process.Kill()
|
||||||
})
|
})
|
||||||
defer timer.Stop()
|
defer timer.Stop()
|
||||||
|
}
|
||||||
|
|
||||||
err = cmd.Start()
|
err = cmd.Start()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
Loading…
Reference in New Issue
Block a user