Remove async pre-empt hack if go >= 1.15 (#12718)
Signed-off-by: Andrew Thornton <art27@cantab.net> Co-authored-by: techknowlogick <techknowlogick@gitea.io>
This commit is contained in:
parent
482b0e6d47
commit
bda9e51fef
@ -11,10 +11,12 @@ import (
|
|||||||
"io"
|
"io"
|
||||||
"os"
|
"os"
|
||||||
"os/exec"
|
"os/exec"
|
||||||
|
"runtime"
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"code.gitea.io/gitea/modules/process"
|
"code.gitea.io/gitea/modules/process"
|
||||||
|
"github.com/mcuadros/go-version"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
@ -130,7 +132,9 @@ func (c *Command) RunInDirTimeoutEnvFullPipelineFunc(env []string, timeout time.
|
|||||||
}
|
}
|
||||||
|
|
||||||
// TODO: verify if this is still needed in golang 1.15
|
// TODO: verify if this is still needed in golang 1.15
|
||||||
cmd.Env = append(cmd.Env, "GODEBUG=asyncpreemptoff=1")
|
if version.Compare(runtime.Version(), "go1.15", "<") {
|
||||||
|
cmd.Env = append(cmd.Env, "GODEBUG=asyncpreemptoff=1")
|
||||||
|
}
|
||||||
cmd.Dir = dir
|
cmd.Dir = dir
|
||||||
cmd.Stdout = stdout
|
cmd.Stdout = stdout
|
||||||
cmd.Stderr = stderr
|
cmd.Stderr = stderr
|
||||||
|
Loading…
Reference in New Issue
Block a user