Skip to content

Commit 075d246

Browse files
authored
feat: Add file copy command timeout duration (#11652)
Refs #11639
1 parent 8b9e7ae commit 075d246

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

core/utils/files/files.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ func CopyItem(isDir, withName bool, src, dst string) error {
6666
if !isDir {
6767
cmdStr = fmt.Sprintf(`cp -f %s %s`, src, dst+"/")
6868
}
69-
stdout, err := cmd.RunDefaultWithStdoutBashC(cmdStr)
69+
stdout, err := cmd.NewCommandMgr(cmd.WithTimeout(60 * time.Second)).RunWithStdoutBashC(cmdStr)
7070
if err != nil {
7171
return fmt.Errorf("handle %s failed, stdout: %s, err: %v", cmdStr, stdout, err)
7272
}

0 commit comments

Comments
 (0)