(installPath string)
| 117 | } |
| 118 | |
| 119 | func 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 | |
| 142 | func loadOpenclawSessionCountFromFile(sessionStorePath string) (int, error) { |
| 143 | content, err := os.ReadFile(sessionStorePath) |
no test coverage detected