mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2024-12-18 03:13:48 +08:00
feat: 增加文件修改权限的超时时间 (#4448)
Refs https://github.com/1Panel-dev/1Panel/issues/4291
This commit is contained in:
parent
437d6eb0fd
commit
35785f1e40
@ -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)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user