mirror of
https://github.com/fankes/beszel.git
synced 2025-10-20 02:09:28 +08:00
move fsStats creation to NewAgent function
This commit is contained in:
@@ -29,6 +29,7 @@ func NewAgent() *Agent {
|
||||
return &Agent{
|
||||
sensorsContext: context.Background(),
|
||||
memCalc: os.Getenv("MEM_CALC"),
|
||||
fsStats: make(map[string]*system.FsStats),
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -18,9 +18,6 @@ func (a *Agent) initializeDiskInfo() {
|
||||
efPath := "/extra-filesystems"
|
||||
hasRoot := false
|
||||
|
||||
// Create map for disk stats
|
||||
a.fsStats = make(map[string]*system.FsStats)
|
||||
|
||||
partitions, err := disk.Partitions(false)
|
||||
if err != nil {
|
||||
slog.Error("Error getting disk partitions", "err", err)
|
||||
|
Reference in New Issue
Block a user