feat: 增加文件修改权限的超时时间 (#4448)

Refs https://github.com/1Panel-dev/1Panel/issues/4291
This commit is contained in:
zhengkunwang 2024-04-09 17:34:09 +08:00 committed by GitHub
parent 437d6eb0fd
commit 35785f1e40
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -157,7 +157,7 @@ func (f FileOp) ChownR(dst string, uid string, gid string, sub bool) error {
if cmd.HasNoPasswordSudo() {
cmdStr = fmt.Sprintf("sudo %s", cmdStr)
}
if msg, err := cmd.ExecWithTimeOut(cmdStr, 2*time.Second); err != nil {
if msg, err := cmd.ExecWithTimeOut(cmdStr, 10*time.Second); err != nil {
if msg != "" {
return errors.New(msg)
}
@ -174,7 +174,7 @@ func (f FileOp) ChmodR(dst string, mode int64, sub bool) error {
if cmd.HasNoPasswordSudo() {
cmdStr = fmt.Sprintf("sudo %s", cmdStr)
}
if msg, err := cmd.ExecWithTimeOut(cmdStr, 2*time.Second); err != nil {
if msg, err := cmd.ExecWithTimeOut(cmdStr, 10*time.Second); err != nil {
if msg != "" {
return errors.New(msg)
}