Skip to content

Commit 856fb89

Browse files
Set WaitDelay on the git command (#50)
So we don't wait indefinitely for the git command to finish after we send the sigterm signal to it on context cancel.
1 parent 5bd8ddd commit 856fb89

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

pkg/mirror/helper.go

+2
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,8 @@ func runGitCommand(ctx context.Context, log *slog.Logger, envs []string, cwd str
200200
log.Log(ctx, -8, "running command", "cwd", cwd, "cmd", cmdStr)
201201

202202
cmd := exec.CommandContext(ctx, gitExecutablePath, args...)
203+
// force kill git 5 seconds after sending it sigterm
204+
cmd.WaitDelay = 5 * time.Second
203205
if cwd != "" {
204206
cmd.Dir = cwd
205207
}

0 commit comments

Comments
 (0)