mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2025-11-11 20:20:48 +08:00
fix: Fix system load spike during disk mount failures (#9399)
Refs #8827
This commit is contained in:
parent
52432002c7
commit
bb8a15ca56
1 changed files with 2 additions and 2 deletions
|
|
@ -390,10 +390,10 @@ type diskInfo struct {
|
||||||
func loadDiskInfo() []dto.DiskInfo {
|
func loadDiskInfo() []dto.DiskInfo {
|
||||||
var datas []dto.DiskInfo
|
var datas []dto.DiskInfo
|
||||||
cmdMgr := cmd.NewCommandMgr(cmd.WithTimeout(2 * time.Second))
|
cmdMgr := cmd.NewCommandMgr(cmd.WithTimeout(2 * time.Second))
|
||||||
stdout, err := cmdMgr.RunWithStdoutBashC("df -hT -P|grep '/'|grep -v tmpfs|grep -v 'snap/core'|grep -v udev")
|
stdout, err := cmdMgr.RunWithStdoutBashC("timeout 2 df -hT -P | awk 'NR>1 && !/tmpfs|snap\\/core|udev/ {print}'")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
cmdMgr2 := cmd.NewCommandMgr(cmd.WithTimeout(1 * time.Second))
|
cmdMgr2 := cmd.NewCommandMgr(cmd.WithTimeout(1 * time.Second))
|
||||||
stdout, err = cmdMgr2.RunWithStdoutBashC("df -lhT -P|grep '/'|grep -v tmpfs|grep -v 'snap/core'|grep -v udev")
|
stdout, err = cmdMgr2.RunWithStdoutBashC("timeout 1 df -lhT -P | awk 'NR>1 && !/tmpfs|snap\\/core|udev/ {print}'")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return datas
|
return datas
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue