Skip to content

Commit bda9e51

Browse files
Remove async pre-empt hack if go >= 1.15 (#12718)
Signed-off-by: Andrew Thornton <[email protected]> Co-authored-by: techknowlogick <[email protected]>
1 parent 482b0e6 commit bda9e51

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

modules/git/command.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,12 @@ import (
1111
"io"
1212
"os"
1313
"os/exec"
14+
"runtime"
1415
"strings"
1516
"time"
1617

1718
"code.gitea.io/gitea/modules/process"
19+
"github.com/mcuadros/go-version"
1820
)
1921

2022
var (
@@ -130,7 +132,9 @@ func (c *Command) RunInDirTimeoutEnvFullPipelineFunc(env []string, timeout time.
130132
}
131133

132134
// TODO: verify if this is still needed in golang 1.15
133-
cmd.Env = append(cmd.Env, "GODEBUG=asyncpreemptoff=1")
135+
if version.Compare(runtime.Version(), "go1.15", "<") {
136+
cmd.Env = append(cmd.Env, "GODEBUG=asyncpreemptoff=1")
137+
}
134138
cmd.Dir = dir
135139
cmd.Stdout = stdout
136140
cmd.Stderr = stderr

0 commit comments

Comments
 (0)