MCPcopy Create free account
hub / github.com/1Panel-dev/1Panel / loadOpenclawOverviewSessionCount

Function loadOpenclawOverviewSessionCount

agent/app/service/agents_overview.go:119–140  ·  view source on GitHub ↗
(installPath string)

Source from the content-addressed store, hash-verified

117}
118
119func loadOpenclawOverviewSessionCount(installPath string) (int, error) {
120 sessionStorePaths, err := filepath.Glob(filepath.Join(installPath, openclawSessionStoreRelativeGlob))
121 if err != nil {
122 return 0, err
123 }
124 total := 0
125 for _, sessionStorePath := range sessionStorePaths {
126 count, err := loadOpenclawSessionCountFromFile(sessionStorePath)
127 if err != nil {
128 continue
129 }
130 total += count
131 }
132 if total > 0 {
133 return total, nil
134 }
135 sessionFiles, err := filepath.Glob(filepath.Join(installPath, openclawSessionFilesRelativeGlob))
136 if err != nil {
137 return 0, err
138 }
139 return len(sessionFiles), nil
140}
141
142func loadOpenclawSessionCountFromFile(sessionStorePath string) (int, error) {
143 content, err := os.ReadFile(sessionStorePath)

Callers 1

GetOverviewMethod · 0.85

Calls 1

Tested by

no test coverage detected